148 FXGLVisual* glVis, FXGLCanvas* share, FXToolBar* toolBar) :
149 GUISUMOAbstractView(tmpParent, app, viewParent, net->getVisualisationSpeedUp(), glVis, share),
150 myViewParent(viewParent),
154 myShowConnections(false),
156 myCreateEdgeSource(0),
161 myAdditionalToMove(0),
162 myMovingIndexShape(-1),
163 myMovingSelection(false),
164 myAmInRectSelect(false),
166 myEditModeCreateEdge(0),
169 myEditModeInspect(0),
171 myEditModeConnection(0),
172 myEditModeTrafficLight(0),
173 myEditModeAdditional(0),
174 myEditModeCrossing(0),
175 myEditModePolygon(0),
177 myUndoList(undoList),
178 myEditJunctionShapePoly(0),
179 myTestingMode(
OptionsCont::getOptions().getBool("gui-testing")) {
181 reparent(actualParent);
183 buildEditModeControls();
185 myNet->setViewNet(
this);
191 assert(windowSize.size() == 2);
192 myTestingWidth = GNEAttributeCarrier::parse<int>(windowSize[0]);
193 myTestingHeight = GNEAttributeCarrier::parse<int>(windowSize[1]);
219 "\tLocate Junction\tLocate a junction within the network.",
221 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
224 "\tLocate Street\tLocate a street within the network.",
226 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
229 "\tLocate TLS\tLocate a tls within the network.",
231 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
234 "\tLocate Additional\tLocate an additional structure within the network.",
236 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
239 "\tLocate PoI\tLocate a PoI within the network.",
241 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
244 "\tLocate Polygon\tLocate a Polygon within the network.",
246 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
271 double minValue = std::numeric_limits<double>::infinity();
272 double maxValue = -std::numeric_limits<double>::infinity();
278 for (
auto it : lanes) {
279 const double val = it->getColorValue(active);
280 minValue =
MIN2(minValue, val);
281 maxValue =
MAX2(maxValue, val);
285 double range = maxValue - minValue;
380 glMatrixMode(GL_MODELVIEW);
382 glDisable(GL_TEXTURE_2D);
383 glDisable(GL_ALPHA_TEST);
385 glEnable(GL_DEPTH_TEST);
390 glTranslated(0, 0,
GLO_MAX - 1);
393 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
427 const double size =
p2m(32);
430 glTranslated(center.
x(), center.
y(),
GLO_MAX - 1);
431 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
434 glVertex2d(0, -size);
435 glVertex2d(size, -size);
455 if (temporalDrawingShape.size() > 0) {
465 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
466 const float minB[2] = { (float)bound.
xmin(), (float)bound.
ymin() };
467 const float maxB[2] = { (float)bound.
xmax(), (float)bound.
ymax() };
469 glEnable(GL_POLYGON_OFFSET_FILL);
470 glEnable(GL_POLYGON_OFFSET_LINE);
486 FXEvent* e = (FXEvent*) eventData;
507 pointed_edge = (
GNEEdge*)pointed;
510 pointed_lane = (
GNELane*)pointed;
514 pointed_poi = (
GNEPOI*)pointed;
517 pointed_poly = (
GNEPoly*)pointed;
537 if ((e->state & CONTROLMASK) == 0) {
542 if (!pointed_junction) {
564 std::cout <<
"edge created without an open CommandGroup )-:\n";
601 }
else if (pointed_poi) {
606 }
else if (pointed_junction) {
611 for (std::vector<GNEJunction*>::const_iterator i = selectedJunctions.begin(); i != selectedJunctions.end(); i++) {
620 }
else if (pointed_edge) {
628 }
else if (pointed_additional) {
671 bool markElementMode = (((FXEvent*)eventData)->state & CONTROLMASK) != 0;
678 if (markElementMode) {
696 if (pointed_junction) {
697 pointedAC = pointed_junction;
698 pointedO = pointed_junction;
699 }
else if (pointed_lane) {
701 pointedAC = pointed_edge;
702 pointedO = pointed_edge;
704 pointedAC = pointed_lane;
705 pointedO = pointed_lane;
707 }
else if (pointed_edge) {
708 pointedAC = pointed_edge;
709 pointedO = pointed_edge;
710 }
else if (pointed_crossing) {
711 pointedAC = pointed_crossing;
712 pointedO = pointed_crossing;
713 }
else if (pointed_additional) {
714 pointedAC = pointed_additional;
715 pointedO = pointed_additional;
716 }
else if (pointed_connection) {
717 pointedAC = pointed_connection;
718 pointedO = pointed_connection;
719 }
else if (pointed_poly) {
720 pointedAC = pointed_poly;
721 pointedO = pointed_poly;
722 }
else if (pointed_poi) {
723 pointedAC = pointed_poi;
724 pointedO = pointed_poi;
727 std::vector<GNEAttributeCarrier*> selectedElements;
728 std::vector<GNEAttributeCarrier*> selectedFilteredElements;
734 for (
auto i : selectedElements) {
735 if (i->getTag() == pointedAC->
getTag()) {
736 selectedFilteredElements.push_back(i);
741 if (selectedFilteredElements.size() > 0) {
743 }
else if (pointedAC != NULL) {
749 if ((selectedFilteredElements.size() > 0) || (pointedAC != NULL)) {
758 }
else if (pointed) {
775 const bool mayPass = (((FXEvent*)eventData)->state & SHIFTMASK) != 0;
776 const bool allowConflict = (((FXEvent*)eventData)->state & CONTROLMASK) != 0;
785 if (pointed_junction) {
794 if (pointed_additional == NULL) {
808 if (pointed_crossing == NULL) {
819 if (pointed_poi == NULL) {
873 i->first->commitGeometryMoving(i->second,
myUndoList);
882 if (((FXEvent*)eventData)->state & SHIFTMASK) {
932 if (pointed_additional != NULL) {
974 for (
auto i : junctionNeighbours) {
1023 if (
myAmInRectSelect && ((((FXEvent*)eventData)->state & SHIFTMASK) ==
false)) {
1041 if (clearSelection) {
1149 throw ProcessError(
"invalid edit mode called by hotkey");
1225 edge = &(((
GNELane*)pointed)->getParentEdge());
1255 std::set<GNEEdge*> result;
1258 for (
auto it : ids) {
1264 result.insert((
GNEEdge*)pointed);
1267 result.insert(&(((
GNELane*)pointed)->getParentEdge()));
1286 return dynamic_cast<GNEPoly*
>(pointed);
1376 if (edges.size() != 0) {
1430 for (
auto it : edges) {
1451 if (polygonUnderMouse) {
1466 if (polygonUnderMouse) {
1481 if (polygonUnderMouse) {
1496 if (polygonUnderMouse) {
1511 if (polygonUnderMouse) {
1526 for (
auto it : lanes) {
1601 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1603 for (
auto i : lanes) {
1607 if (mapOfEdgesAndLanes.size() != lanes.size()) {
1608 FXMessageBox::information(getApp(), MBOX_OK,
1609 "Multiple lane in the same edge selected",
"%s",
1610 (
"There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " +
toString(vclass) +
".").c_str());
1613 if (mapOfEdgesAndLanes.size() > 0) {
1617 for (
auto i : mapOfEdgesAndLanes) {
1618 if (i.first->hasRestrictedLane(vclass)) {
1623 if (counter == (
int)mapOfEdgesAndLanes.size()) {
1624 FXMessageBox::information(getApp(), MBOX_OK,
1625 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1626 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1633 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1634 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1635 (
toString(mapOfEdgesAndLanes.size() - counter) +
" lanes will be restricted for " +
toString(vclass) +
". continue?").c_str());
1639 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'No'");
1641 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
1647 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
1654 for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
1682 std::set<GNEEdge*> setOfEdges;
1684 for (
auto i : edges) {
1685 setOfEdges.insert(i);
1688 for (
auto it : lanes) {
1693 if (setOfEdges.size() > 0) {
1697 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1699 if ((*it)->hasRestrictedLane(vclass)) {
1704 if (counter == (
int)setOfEdges.size()) {
1705 FXMessageBox::information(getApp(), MBOX_OK,
1706 (
"Add vclass for" +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1707 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1714 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1715 (
"Add vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1716 (
toString(setOfEdges.size() - counter) +
" restrictions for " +
toString(vclass) +
" will be added. continue?").c_str());
1720 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'No'");
1722 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
1728 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
1735 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1763 std::set<GNEEdge*> setOfEdges;
1765 for (
auto i : edges) {
1766 setOfEdges.insert(i);
1769 for (
auto it : lanes) {
1774 if (setOfEdges.size() > 0) {
1778 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1780 if ((*it)->hasRestrictedLane(vclass)) {
1786 FXMessageBox::information(getApp(), MBOX_OK,
1787 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1788 (
"Selected lanes and edges haven't a restriction for " +
toString(vclass)).c_str());
1795 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1796 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1797 (
toString(counter) +
" restrictions for " +
toString(vclass) +
" will be removed. continue?").c_str());
1801 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'No'");
1803 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
1809 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
1816 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1843 if (e->click_count == 2) {
1844 handle(
this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
1853 std::vector<GNELane*> lanes;
1859 for (
auto i : edges) {
1860 for (
auto j : i->getLanes()) {
1869 if (lanes.size() > 0) {
1873 for (
auto it : lanes) {
1880 FXMessageBox::information(getApp(), MBOX_OK,
1881 "Revert restriction",
"%s",
1882 "None of selected lanes has a previous restriction");
1889 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1890 "Revert restriction",
"%s",
1891 (
toString(counter) +
" restrictions of lanes lanes will be reverted. continue?").c_str());
1895 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'No'");
1897 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
1903 WRITE_WARNING(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
1910 for (
auto it : lanes) {
1943 if (junction != 0) {
2220 if (junctions.size() > 0) {
2221 std::string plural = junctions.size() == 1 ? (
"") : (
"s");
2223 for (
auto i : junctions) {
2234 if (lanes.size() > 0) {
2235 std::string plural = lanes.size() == 1 ? (
"") : (
"s");
2237 for (
auto i : lanes) {
2248 if (edges.size() > 0) {
2249 std::string plural = edges.size() == 1 ? (
"") : (
"s");
2251 for (
auto i : edges) {
2262 if (additionals.size() > 0) {
2263 std::string plural = additionals.size() == 1 ? (
"") : (
"s");
2265 for (
auto i : additionals) {
2278 std::vector<GNECrossing*> crossings;
2279 for (
auto i : junctions) {
2280 for (
auto j : i->getGNECrossings()) {
2282 crossings.push_back(j);
2287 if (crossings.size() > 0) {
2288 std::string plural = crossings.size() == 1 ? (
"") : (
"s");
2290 for (
auto i : crossings) {
2302 std::vector<GNEConnection*> connections;
2303 for (
auto i : edges) {
2304 for (
auto j : i->getGNEConnections()) {
2306 connections.push_back(j);
2311 if (connections.size() > 0) {
2312 std::string plural = connections.size() == 1 ? (
"") : (
"s");
2314 for (
auto i : connections) {
2325 std::vector<GNEPOI*> selectedPOIs;
2329 selectedPOIs.push_back(poi);
2332 if (selectedPOIs.size() > 0) {
2333 std::string plural = selectedPOIs.size() == 1 ? (
"") : (
"s");
2335 for (
auto i : selectedPOIs) {
2346 std::vector<GNEPoly*> selectedPolygons;
2350 selectedPolygons.push_back(Polygon);
2353 if (selectedPolygons.size() > 0) {
2354 std::string plural = selectedPolygons.size() == 1 ? (
"") : (
"s");
2356 for (
auto i : selectedPolygons) {
2371 selection.
add(newPos);
2372 selection.
grow(0.1);
2375 for (
auto it_ids : ids) {
2396 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
2397 "Confirm Junction Merger",
"%s",
2398 (
"Do you wish to merge junctions '" + moved->
getMicrosimID() +
2401 "' will be eliminated and its roads added to '" +
2406 WRITE_WARNING(
"Closed FXMessageBox 'merge junctions' with 'No'");
2408 WRITE_WARNING(
"Closed FXMessageBox 'merge junctions' with 'ESC'");
2414 WRITE_WARNING(
"Closed FXMessageBox 'merge junctions' with 'Yes'");
GUIVisualizationSizeSettings junctionSize
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
void buildColorRainbow(GUIColorScheme &scheme, int active, GUIGlObjectType objectType)
recalibrate color scheme according to the current value range
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
restore geometry endpoint to node position
GNEViewParent * myViewParent
view parent
virtual void openAdditionalDialog()
open Additional Dialog
void paintGLGrid()
paints a grid
EditMode getCurrentEditMode() const
get the current edit mode
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
double xmax() const
Returns maximum x-coordinate.
long onCmdRestrictLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to bikes
void moveJunctionGeometry2D(Position pos2D)
reposition the node as above but keep the old z value
static const RGBColor BLUE
bool showLockIcon() const
check if lock icon should be visible
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
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) ...
std::vector< GUIGlID > getObjectsAtPosition(Position pos, double radius)
returns the ids of the object at position within the given (rectangular) radius using GL_SELECT ...
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
bool selectEdges()
whether inspection, selection and inversion should apply to edges or to lanes
GNEJunction * getJunctionAtCursorPosition(Position &pos)
try to retrieve a junction at the given position
void openPolygon(bool allowUndo=true)
open polygon
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position myPopupSpot
Poput spot.
GUICompleteSchemeStorage gSchemeStorage
AddAdditionalResult addAdditional(GNENetElement *netElement, GUISUMOAbstractView *abstractViewParent)
add additional element
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
double scale
information about a lane's width (temporary, used for a single view)
mode for inspecting object attributes
GNEJunction * getGNEJunctionSource() const
returns the source-junction
void removePolygonOfView(GNEPoly *p)
remove polygon of view net
void abortOperation(bool clearSelection=true)
abort current edition operation
turn junction into geometry node
void deleteSelectedJunctions()
delete all currently selected junctions
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
bool setColorScheme(const std::string &name)
set color scheme
long onCmdSetModeAdditional(FXObject *, FXSelector, void *)
called when user press the button for additional mode
bool changeAllPhases() const
change all phases
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
void stopEditShapeJunction()
edit edit junction shape
void deletePOI(GNEPOI *POI, GNEUndoList *undoList)
remove POI
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
void markPopupPosition()
store the position where a popup-menu was requested
Position myMovingReference
variable for calculating moving offset (Used when user doesn't click exactly over the center of shape...
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...
bool removePolygon(const std::string &id)
Removes a polygon from the container.
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
GNEPoly * addPolygonForEditShapes(GNEJunction *junction)
Builds a special polygon used for edit Junctions's shapes.
void markAsCreateEdgeSource()
marks as first junction in createEdge-mode
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
The main window of the Netedit.
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
int myTestingHeight
Height of viewNet in testing mode.
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
void hotkeyFocusFrame()
handle focus frame keypress
AddShapeResult
FOX-declaration.
FXMenuCheck * myMenuCheckShowGrid
show grid button
bool revertLaneRestriction(GNELane *lane, GNEUndoList *undoList)
revert prevously restricted lane
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void removeAttributeCarrier(GNEAttributeCarrier *ac)
remove attribute carrier (element)
void toggleSelection(GUIGlID id)
Toggles selection of an object.
virtual long onMouseMove(FXObject *, FXSelector, void *)
FXMenuCheck * myChainCreateEdge
whether the endpoint for a created edge should be set as the new source
double exaggeration
The size exaggeration (upscale)
Set a vertex of polygon as first verte.
double ymax() const
Returns maximum y-coordinate.
double x() const
Returns the x-position.
connectio between two lanes
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
void updateCurrentLabel(GNEAttributeCarrier *ac)
update current label
long onCmdToogleSelectEdges(FXObject *, FXSelector, void *)
toogle selet edges
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(...)
GUIMainWindow * myApp
The application.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
void setEditMode(EditMode mode)
set edit mode
static void resetTextures()
Reset textures.
Position moveGeometry(const Position &oldPos, const Position &newPos, bool relative=false)
change the edge geometry It is up to the Edge to decide whether an new geometry node should be genera...
MFXCheckableButton * myEditModeSelect
chekable button for edit mode select
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
Position mySelCorner2
second corner of the rectangle-selection
AddShapeResult processClick(const Position &clickedPosition)
process click over Viewnet
simplify polygon geometry
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
const PositionVector & getShape() const
Returns whether the shape of the polygon.
NBNode * getNBNode() const
Return net build node.
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
virtual Position getPositionInView() const =0
Returns position of additional in view.
static const RGBColor ORANGE
MFXCheckableButton * myEditModeMove
chekable button for edit mode move
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
void splitEdgesBidi(const std::set< GNEEdge * > &edges, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Position getPositionInView() const
Return current position.
MFXCheckableButton * myEditModeDelete
chekable button for edit mode delete
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
A NBNetBuilder extended by visualisation and editing capabilities.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
GNEEdge * createEdge(GNEJunction *src, GNEJunction *dest, GNEEdge *tpl, GNEUndoList *undoList, const std::string &suggestedName="", bool wasSplit=false, bool allowDuplicateGeom=false)
creates a new edge (unless an edge with the same geometry already exists)
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...
GNEPOI * myPoiToMove
the poi which is being moved
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
void deleteSelectedPolygons()
delete all currently selected Polygons
begin/end of the description of a polygon
GNEPolygonFrame::DrawingMode * getDrawingMode() const
get drawing mode
long onCmdSetEdgeEndpoint(FXObject *, FXSelector, void *)
set non-default geometry endpoint
void handleIDs(std::vector< GUIGlID > ids, bool selectEdgesEnabled, SetOperation setop=SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
PositionVector myMovingOriginalShape
Shape of elements before moving (needed for commmit shape changes)
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
GNEViewParent * getViewParent() const
get the net object
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList)
removes edge
void set(double x, double y)
set positions x and y
int myMovingIndexShape
current index of shape that are being moved
void updateControls()
update control contents after undo/redo or recompute
EditMode myPreviousEditMode
the previous edit mode before edit junction's shapes
bool isMovementBlocked() const
return true if movement is blocked
const Polygons & getPolygons() const
Returns all polygons.
FXMenuCheck * myMenuCheckChangeAllPhases
menu check to set change all phases
GUIGlID getGlID() const
Returns the numerical id of the object.
GNEEdge * myEdgeToMove
the edge of which geometry is being moved
A class that stores a 2D geometrical boundary.
void closePolygon(bool allowUndo=true)
close polygon
#define WRITE_WARNING(msg)
A single child window which contains a view of the simulation area.
transform lane to sidewalk
static OptionsCont & getOptions()
Retrieves the options.
Position screenPos2NetPos(int x, int y) const
Translate screen position to network position.
GNEPoly * myEditJunctionShapePoly
GNEUndoList * getUndoList() const
get the undoList object
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 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
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Locate addtional structure - button.
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...
const std::string & getID() const
Returns the id.
void insert(const std::string str, const T key, bool checkDuplicates=true)
mode for editing additional
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildEditModeControls()
adds controls for setting the edit mode
std::vector< GNEJunction * > getJunctionNeighbours() const
return GNEJunction neighbours
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
std::set< GNEEdge * > getEdgesAtCursorPosition(Position &pos)
try to retrieve multiple edges at the given position
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
transform lane to busLane
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
void removeLastPoint()
remove last added point
long onLeftBtnPress(FXObject *, FXSelector, void *)
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
const Position & getPosition() const
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
static const RGBColor GREEN
void computeNodeShape(double mismatchThreshold)
Compute the junction shape for this node.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
virtual long onPaint(FXObject *, FXSelector, void *)
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
int addColor(const T &color, const double threshold, const std::string &name="")
long onCmdRemoveRestrictedLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for bus
std::string name
The name of this setting.
void deleteSelectedConnections()
delete all currently selected connections
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
mode for creating polygons
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)
static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr)
check if an element with certain tag has a certain attribute
virtual void setStatusBarText(const std::string &)
void deleteSelectedCrossings()
delete all currently selected crossings
GNEAdditional * myAdditionalToMove
the stoppingPlace element which shape is being moved
GNELane * getLane() const
get lane of additional, or NULL if additional isn't placed over a Lane
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
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
std::map< GNEJunction *, Position > myOriginPostionOfMovedJunctions
Junctions that are being moved.
virtual ~GNEViewNet()
destructor
set non-default geometry endpoint
int moveVertexShape(int index, const Position &newPos)
change position of a vertex of shape without commiting change
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.
double m2p(double meter) const
meter-to-pixels conversion method
double p2m(double pixel) const
pixels-to-meters conversion method
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
FXMenuCheck * myMenuCheckSelectEdges
menu check to select only edges
FXToolBar * myToolbar
a reference to the toolbar in myParent
FXComboBox & getColoringSchemesCombo()
void deleteLane(GNELane *lane, GNEUndoList *undoList)
removes lane
long onCmdToogleShowConnection(FXObject *, FXSelector, void *)
toogle show connections
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
MFXCheckableButton * myEditModeCreateEdge
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
double y() const
Returns the y-position.
show junctions as bubbles
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
registers completed movement with the undoList
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
void deleteSelectedPOIs()
delete all currently selected POIs
long onCmdRevertRestriction(FXObject *, FXSelector, void *)
revert transformation
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
static const RGBColor MAGENTA
bool isDrawing() const
return true if currently a shape is drawed
virtual void moveGeometry(const Position &newPosition)=0
change the position of the element geometry without saving in undoList
MFXCheckableButton * myEditModeTrafficLight
chekable button for edit mode traffic light
GNECrossingFrame * getCrossingFrame() const
get frame for GNE_MODE_CROSSING
void initGNEConnections()
initialize GNEConnections
long onCmdRemoveRestrictedLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for bikes
mode for selecting objects
GNEJunction * myJunctionToMove
the Junction to be moved.
bool addCrossing(GNENetElement *netElement)
add Crossing element
MFXCheckableButton * myEditModeAdditional
chekable button for edit mode additional
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
GNELane * getLaneAtCurserPosition(Position &pos)
try to retrieve a lane at the given position
edge: the shape in xml-definition
Locate junction - button.
mode for selecting objects
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(const std::set< GUIGlID > &ids, GUIGlObjectType type)
get the attribute carriers based on GlIDs
Boundary & grow(double by)
extends the boundary by the given amount
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
mode for editing crossing
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
GNEConnectorFrame * getConnectorFrame() const
get frame for GNE_MODE_CONNECT
void unMarkAsCreateEdgeSource()
removes mark as first junction in createEdge-mode
void startDrawing()
start drawing
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
const PositionVector & getTemporalShape() const
get Temporal shape
void moveSelection(const Position &moveSrc, const Position &moveDest)
move all selected junctions and edges
Position getPositionInView() const
Returns position of additional in view.
void focusUpperElement()
focus upper element of frame
int myTestingWidth
Width of viewNet in testing mode.
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
const POIs & getPOIs() const
Returns all pois.
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in allGNEAttributeCarrier.
Position mySelCorner1
firstcorner of the rectangle-selection
void p_abort()
reverts and discards ALL active command groups
const PositionVector & getShape() const
retrieve the junction shape
GUIPerspectiveChanger * myChanger
The perspective changer.
long onCmdRestrictLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to buslanes
GNEJunction * getShapeEditedJunction() const
retrieve the junction of which the shape is being edited
bool myUseToolTips
use tool tips
virtual void onLeftBtnPress(void *data)
mouse functions
void destroyPopup()
destoys the popup
void doInit()
called after some features are already initialized
begin/end of the description of an edge
FXMenuCheck * myAutoCreateOppositeEdge
void setSelectionScaling(double selectionScale)
set selection scaling
bool mergeJunctions(GNEJunction *moved)
try to merge moved junction with another junction in that spot return true if merging did take place ...
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 IDMap & getMyMap() const
Returns a reference to the internal map.
void commitGeometryMoving(const PositionVector &oldShape, double minDistToEnd, GNEUndoList *undoList)
registers completed movement with the undoList
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 deleteGeometryNear(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
FXbool makeCurrent()
A reimplementation due to some internal reasons.
long onCmdOK(FXObject *, FXSelector, void *)
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
AddAdditionalResult
FOX-declaration.
static const double BUBBLE_RADIUS
void deletePolygon(GNEPoly *polygon, GNEUndoList *undoList)
remove Polygon
static const RGBColor YELLOW
Mode for editing Polygons.
static const RGBColor RED
named colors
const PositionVector & getShape() const
returns the shape of the lane
FXMenuCheck * myMenuCheckWarnAboutMerge
whether we should warn about merging junctions
double selectionScale
the current selection scaling in NETEDIT (temporary)
#define GUIDesignButtonToolbarCheckable
little checkable button with icon placed in navigation toolbar
virtual void show()
show Frame
static const RGBColor CYAN
bool hasCommandGroup() const
Check if undoList has command group.
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
long onCmdAddRestrictedLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for bikes.
FXMenuCheck * myMenuCheckShowBubbleOverJunction
show connection as buuble in "Move" mode.
An Element which don't belongs to GNENet but has influency in the simulation.
void show()
show additional frame and update use selected edges/lanes
MFXCheckableButton * myEditModeConnection
chekable button for edit mode connection
bool showConnections()
show connections over junctions
double xmin() const
Returns minimum x-coordinate.
long onCmdOK(FXObject *, FXSelector, void *)
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
long onCmdSetModeTLS(FXObject *, FXSelector, void *)
called when user press the button for traffic lights mode
bool isShapeBlocked() const
return true if shape is blocked
GNEPoly * getPolygonAtCursorPosition(Position &pos)
try to retrieve a Polygon at the given position
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
GNEJunction * myCreateEdgeSource
source junction for new edge 0 if no edge source is selected an existing (or newly created) junction ...
void abortDrawing()
abort drawing
A storage for options typed value containers)
Locate polygons - button.
long onCmdAddRestrictedLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for buses.
long onCmdRemoveRestrictedLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for pedestrians
transform lane to bikelane
GNEAttributeCarrier * getMarkedAttributeCarrier() const
returns marked atrribute carrier
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
crossing between edges for pedestrians
GNENet * getNet() const
get the net object
void clear()
Clears the list of selected objects.
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
double ymin() const
Returns minimum y-coordinate.
bool showGrid
Information whether a grid shall be shown.
void drawDecals()
Draws the stored decals.
void show()
show inspector frame
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
long onCmdRestrictLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to pedestrians
void updateModeSpecificControls()
updates mode specific controls
MFXCheckableButton * myEditModeCrossing
chekable button for edit mode crossing
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false)
return all additionals
SumoXMLTag getTag() const
get XML Tag assigned to this object
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 hideAllFrames()
hide all frames
long onCmdSetModeConnect(FXObject *, FXSelector, void *)
called when user press the button for connect mode
Mode for editing additionals.
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
void setEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end
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
mode for connecting lanes
bool myMovingSelection
whether a selection is being moved
mode for creating new edges
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
NBEdge * getNBEdge()
returns the internal NBEdge
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_MODE_TLS
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.
long onDoubleClicked(FXObject *, FXSelector, void *)
called when user press mouse's left button two times
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIGlID getObjectUnderCursor()
returns the id of the object under the cursor using GL_SELECT
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
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
GNEEdge * getEdgeAtCursorPosition(Position &pos)
try to retrieve an edge at the given position
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
void hotkeyDel()
handle del keypress
void startEditShapeJunction(GNEJunction *junction)
start edit junction shape
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
bool myAmInRectSelect
whether we have started rectangle-selection
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool addSRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
add restricted lane to edge
GUISelectedStorage gSelected
A global holder of selected objects.
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
void hotkeyEnter()
handle enter keypress
GNEPolygonFrame * getPolygonFrame() const
get frame for GNE_MODE_POLYGON
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
restore geometry endpoint to node position
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
long onCmdShowGrid(FXObject *, FXSelector, void *)
toogle show grid
void processClick(FXEvent *e, void *data)
Auxiliar function used by onLeftBtnPress(...)
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
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
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
EditMode myEditMode
the current edit mode
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
mode for connecting lanes
bool addRestrictedLane(SUMOVehicleClass vclass)
add restricted lane
std::vector< GUIGlID > getObjectsInBoundary(const Boundary &bound)
returns the ids of all objects in the given boundary
MFXCheckableButton * myEditModePolygon
chekable button for edit mode polygon
begin/end of the description of a polygon
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
FXPopup * getLocatorPopup()
GNEFrame * myCurrentFrame
the current frame
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
Position myMovingOriginalPosition
original Position of element before moving (needed for commmit position changes)
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
GNEPoly * myPolyToMove
the poly of which geometry is being moved
void finishMoveSelection(GNEUndoList *undoList)
register changes to junction and edge positions with the undoList