131 FXGLVisual* glVis, FXGLCanvas* share, FXToolBar* toolBar) :
132 GUISUMOAbstractView(tmpParent, app, viewParent, net->getVisualisationSpeedUp(), glVis, share),
133 myViewParent(viewParent),
136 myPreviousEditMode(GNE_MODE_MOVE),
138 myShowConnections(false),
140 myCreateEdgeSource(0),
145 myAdditionalToMove(0),
146 myMoveSelection(false),
147 myAmInRectSelect(false),
149 myEditModeCreateEdge(0),
152 myEditModeInspect(0),
154 myEditModeConnection(0),
155 myEditModeTrafficLight(0),
156 myEditModeAdditional(0),
157 myEditModeCrossing(0),
159 myUndoList(undoList),
161 myTestingMode(
OptionsCont::getOptions().getBool("gui-testing")) {
163 reparent(actualParent);
165 buildEditModeControls();
167 myNet->setViewNet(
this);
180 scheme =
GUIColorScheme(
"by selection (lane-/streetwise)",
RGBColor(128, 128, 128, 255),
"unselected",
true);
252 myVisualizationSettings->laneColorer = laneColorer;
276 myVisualizationSettings->junctionColorer = junctionColorer;
280 assert(windowSize.size() == 2);
281 myTestingWidth = GNEAttributeCarrier::parse<int>(windowSize[0]);
282 myTestingHeight = GNEAttributeCarrier::parse<int>(windowSize[1]);
299 for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
309 "\tLocate Junction\tLocate a junction within the network.",
311 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
314 "\tLocate Street\tLocate a street within the network.",
316 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
319 "\tLocate TLS\tLocate a tls within the network.",
321 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
324 "\tLocate Additional\tLocate an additional structure within the network.",
326 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
329 "\tLocate PoI\tLocate a PoI within the network.",
331 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
334 "\tLocate Polygon\tLocate a Polygon within the network.",
336 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
413 glMatrixMode(GL_MODELVIEW);
415 glDisable(GL_TEXTURE_2D);
416 glDisable(GL_ALPHA_TEST);
418 glEnable(GL_DEPTH_TEST);
423 glTranslated(0, 0,
GLO_MAX - 1);
426 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
459 const double size =
p2m(32);
462 glTranslated(center.
x(), center.
y(),
GLO_MAX - 1);
463 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
466 glVertex2d(0, -size);
467 glVertex2d(size, -size);
477 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
478 const float minB[2] = { (float)bound.
xmin(), (float)bound.
ymin() };
479 const float maxB[2] = { (float)bound.
xmax(), (float)bound.
ymax() };
481 glEnable(GL_POLYGON_OFFSET_FILL);
482 glEnable(GL_POLYGON_OFFSET_LINE);
497 FXEvent* e = (FXEvent*) data;
521 pointed_edge = (
GNEEdge*)pointed;
524 pointed_lane = (
GNELane*)pointed;
528 pointed_poi = (
GNEPOI*)pointed;
531 pointed_poly = (
GNEPoly*)pointed;
551 if ((e->state & CONTROLMASK) == 0) {
556 if (!pointed_junction) {
578 std::cout <<
"edge created without an open CommandGroup )-:\n";
604 }
else if (pointed_poi) {
607 }
else if (pointed_junction) {
614 }
else if (pointed_edge) {
621 }
else if (pointed_additional) {
667 bool markElementMode = (((FXEvent*)data)->state & CONTROLMASK) != 0;
674 if (markElementMode) {
694 if (pointed_junction) {
695 pointedAC = pointed_junction;
696 pointedO = pointed_junction;
697 }
else if (pointed_lane) {
699 pointedAC = pointed_edge;
700 pointedO = pointed_edge;
702 pointedAC = pointed_lane;
703 pointedO = pointed_lane;
705 }
else if (pointed_edge) {
706 pointedAC = pointed_edge;
707 pointedO = pointed_edge;
708 }
else if (pointed_crossing) {
709 pointedAC = pointed_crossing;
710 pointedO = pointed_crossing;
711 }
else if (pointed_additional) {
712 pointedAC = pointed_additional;
713 pointedO = pointed_additional;
714 }
else if (pointed_connection) {
715 pointedAC = pointed_connection;
716 pointedO = pointed_connection;
719 std::vector<GNEAttributeCarrier*> selectedElements;
720 std::vector<GNEAttributeCarrier*> selectedFilteredElements;
726 for (std::vector<GNEAttributeCarrier*>::iterator i = selectedElements.begin(); i != selectedElements.end(); i++) {
727 if ((*i)->getTag() == pointedAC->
getTag()) {
728 selectedFilteredElements.push_back(*i);
733 if (selectedFilteredElements.size() > 0) {
735 }
else if (pointedAC != NULL) {
741 if ((selectedFilteredElements.size() > 0) || (pointedAC != NULL)) {
750 }
else if (pointed) {
767 const bool mayPass = (((FXEvent*)data)->state & SHIFTMASK) != 0;
768 const bool allowConflict = (((FXEvent*)data)->state & CONTROLMASK) != 0;
777 if (pointed_junction) {
786 if (pointed_additional == NULL) {
800 if (pointed_crossing == NULL) {
854 if (((FXEvent*)data)->state & SHIFTMASK) {
881 if (pointed_additional != NULL) {
921 for (std::vector<GNEJunction*>::iterator i = junctionNeighbours.begin(); i != junctionNeighbours.end(); i++) {
922 if ((*i)->getPosition() == clickedPosition) {
942 Position moveTarget = clickedPosition;
964 if (clearSelection) {
1049 throw ProcessError(
"invalid edit mode called by hotkey");
1127 edge = &(((
GNELane*)pointed)->getParentEdge());
1157 std::set<GNEEdge*> result;
1160 for (std::vector<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); ++it) {
1166 result.insert((
GNEEdge*)pointed);
1169 result.insert(&(((
GNELane*)pointed)->getParentEdge()));
1257 if (edges.size() != 0) {
1311 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
1352 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1427 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1429 for (std::vector<GNELane*>::iterator i = lanes.begin(); i != lanes.end(); i++) {
1433 if (mapOfEdgesAndLanes.size() != lanes.size()) {
1434 FXMessageBox::information(getApp(), MBOX_OK,
1435 "Multiple lane in the same edge selected",
"%s",
1436 (
"There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " +
toString(vclass) +
".").c_str());
1439 if (mapOfEdgesAndLanes.size() > 0) {
1443 for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
1444 if (i->first->hasRestrictedLane(vclass)) {
1449 if (counter == (
int)mapOfEdgesAndLanes.size()) {
1450 FXMessageBox::information(getApp(), MBOX_OK,
1451 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1452 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1459 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1460 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1461 (
toString(mapOfEdgesAndLanes.size() - counter) +
" lanes will be restricted for " +
toString(vclass) +
". continue?").c_str());
1465 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
1467 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
1473 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
1480 for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
1508 std::set<GNEEdge*> setOfEdges;
1510 for (std::vector<GNEEdge*>::iterator i = edges.begin(); i != edges.end(); i++) {
1511 setOfEdges.insert(*i);
1514 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1519 if (setOfEdges.size() > 0) {
1523 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1525 if ((*it)->hasRestrictedLane(vclass) ==
true) {
1530 if (counter == (
int)setOfEdges.size()) {
1531 FXMessageBox::information(getApp(), MBOX_OK,
1532 (
"Add vclass for" +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1533 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1540 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1541 (
"Add vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1542 (
toString(setOfEdges.size() - counter) +
" restrictions for " +
toString(vclass) +
" will be added. continue?").c_str());
1546 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
1548 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
1554 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
1561 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1589 std::set<GNEEdge*> setOfEdges;
1591 for (std::vector<GNEEdge*>::iterator i = edges.begin(); i != edges.end(); i++) {
1592 setOfEdges.insert(*i);
1595 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1600 if (setOfEdges.size() > 0) {
1604 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1606 if ((*it)->hasRestrictedLane(vclass) ==
true) {
1612 FXMessageBox::information(getApp(), MBOX_OK,
1613 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1614 (
"Selected lanes and edges haven't a restriction for " +
toString(vclass)).c_str());
1621 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1622 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1623 (
toString(counter) +
" restrictions for " +
toString(vclass) +
" will be removed. continue?").c_str());
1627 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
1629 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
1635 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
1642 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1669 if (e->click_count == 2) {
1670 handle(
this, FXSEL(SEL_DOUBLECLICKED, 0), data);
1679 std::vector<GNELane*> lanes;
1685 for (std::vector<GNEEdge*>::iterator i = edges.begin(); i != edges.end(); i++) {
1686 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
1687 lanes.push_back(*j);
1695 if (lanes.size() > 0) {
1699 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1706 FXMessageBox::information(getApp(), MBOX_OK,
1707 "Revert restriction",
"%s",
1708 "None of selected lanes has a previous restriction");
1715 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1716 "Revert restriction",
"%s",
1717 (
toString(counter) +
" restrictions of lanes lanes will be reverted. continue?").c_str());
1721 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
1723 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
1729 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
1736 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1758 if (junction != 0) {
1801 if (junction != 0) {
2064 for (std::vector<GNEJunction*>::iterator it = junctions.begin(); it != junctions.end(); it++) {
2076 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
2082 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
2094 for (std::vector<GNEAdditional*>::iterator it = additionals.begin(); it != additionals.end(); it++) {
2108 selection.
add(newPos);
2109 selection.
grow(0.1);
2112 for (std::vector<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
2134 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
2135 "Confirm Junction Merger",
"%s",
2136 (
"Do you wish to merge junctions '" + moved->
getMicrosimID() +
2139 "' will be eliminated and its roads added to '" +
2144 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
2146 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
2152 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
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
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
restore geometry endpoint to node position
long onCmdDeleteGeometry(FXObject *, FXSelector, void *)
delete the closes geometry point
GNEViewParent * myViewParent
view parent
virtual void openAdditionalDialog()
open Additional Dialog
void paintGLGrid()
paints a grid
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
long onCmdRestrictLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to bikes
GNELane * getLane() const
get lane of additional, or NULL if additional isn't placed over a Lane
static const RGBColor BLUE
Position moveGeometry(const Position &oldPos, const Position &newPos, bool relative=false)
draw the polygon and also little movement handles
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 ...
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
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
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
double xmax() const
Returns maximum x-coordinate.
Position myPopupSpot
Poput spot.
GUICompleteSchemeStorage gSchemeStorage
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)
void abortOperation(bool clearSelection=true)
abort current edition operation
void deleteSelectedJunctions()
delete all currently selected junctions
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
bool setColorScheme(const std::string &name)
set color schieme
long onCmdSetModeAdditional(FXObject *, FXSelector, void *)
called when user press the button for additional mode
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
void move(Position pos)
reposition the POI at pos and informs the edges
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
void markPopupPosition()
store the position where a popup-menu was requested
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
begin/end of the description of a junction
bool myShowConnections
whether show connections has been activated once
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
void markAsCreateEdgeSource()
marks as first junction in createEdge-mode
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.
void setAllowsNegativeValues(bool value)
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
void hotkeyFocusFrame()
handle focus frame keypress
FXMenuCheck * myMenuCheckShowGrid
show grid button
bool revertLaneRestriction(GNELane *lane, GNEUndoList *undoList)
revert prevously restricted lane
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
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
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
GUIMainWindow * myApp
The application.
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
vehicle is a small delivery vehicle
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...
void computeEverything(GNEApplicationWindow *window, bool force=false)
MFXCheckableButton * myEditModeSelect
chekable button for edit mode select
Position mySelCorner2
second corner of the rectangle-selection
classes which (normally) do not drive on normal roads
void removeAdditionalGLObject(GUIGlObject *o)
Removes an additional object (detector/shape/trigger) from being visualised.
double x() const
Returns the x-position.
turn junction into geometry node
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
GNEJunction * getEditedJunction() const
retrieve the junction of which the shape is being edited
long onCmdNodeShape(FXObject *, FXSelector, void *)
input custom node shape
static const RGBColor ORANGE
MFXCheckableButton * myEditModeMove
chekable button for edit mode move
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)
mode for selecting objects
void commmitAdditionalGeometryMoved(const Position &oldPos, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
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)
transform lane to sidewalk
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,
static const RGBColor BLACK
const std::string & getID() const
Returns the id.
Locate polygons - button.
const SVCPermissions SVCAll
all VClasses are allowed
void setLineWidth(double lineWidth)
set a new shape and update the tesselation
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
set non-default geometry endpoint
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList)
removes edge
void set(double x, double y)
set positions x and y
void updateControls()
update control contents after undo/redo or recompute
EditMode myPreviousEditMode
the previous edit mode used for toggling
void registerMove(GNEUndoList *undoList)
registers completed movement with the undoList
FXMenuCheck * myMenuCheckChangeAllPhases
menu check to set change all phases
const PositionVector & getShape() const
Returns whether the shape of the polygon.
GNEEdge * myEdgeToMove
the edge of which geometry is being moved
A class that stores a 2D geometrical boundary.
virtual std::string getAttribute(SumoXMLAttr key) const =0
#define WRITE_WARNING(msg)
A single child window which contains a view of the simulation area.
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_MODE_TLS
static OptionsCont & getOptions()
Retrieves the options.
bool isTestingModeEnabled() const
check if netedit is running in testing mode
double p2m(double pixel) const
pixels-to-meters conversion method
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
bool myMoveSelection
whether a selection is being moved
long onCmdSetModeCrossing(FXObject *, FXSelector, void *)
called when user press the button for crossing mode
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
simplify polygon geometry
restore geometry endpoint to node position
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...
mode for inspecting object attributes
void insert(const std::string str, const T key, bool checkDuplicates=true)
std::string getAttribute(SumoXMLAttr key) const
Position myOldAdditionalPosition
variable for saving additional position before moving
void buildEditModeControls()
adds controls for setting the edit mode
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
GNEUndoList * getUndoList() const
get the undoList object
long onLeftBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's left button
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.
static const RGBColor GREY
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="")
GNEPoly * myCurrentPoly
current polygon
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.
bool hasCommandGroup() const
Check if undoList has command group.
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)
static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr)
check if an element with certain tag has a certain attribute
virtual void setStatusBarText(const std::string &)
GNEAdditional * myAdditionalToMove
the stoppingPlace element which shape is being moved
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 ~GNEViewNet()
destructor
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.
transform lane to bikelane
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
MFXCheckableButton * myEditModeCreateEdge
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
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
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
long onCmdRemoveRestrictedLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for bikes
mode for selecting objects
void removeCurrentPoly()
remove the currently edited polygon
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
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
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
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void unMarkAsCreateEdgeSource()
removes mark as first junction in createEdge-mode
mode for editing crossing
void moveSelection(const Position &moveSrc, const Position &moveDest)
move all selected junctions and edges
Position screenPos2NetPos(int x, int y) const
Translate screen position to network position.
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
void splitEdgesBidi(const std::set< GNEEdge *> &edges, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Position mySelCorner1
firstcorner of the rectangle-selection
Position myAdditionalMovingReference
variable for calculating moving offset of additionals
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
virtual void onLeftBtnPress(void *data)
mouse functions
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
vehicle is a passenger car (a "normal" car)
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
EditMode getCurrentEditMode() const
get the current edit mode
bool mergeJunctions(GNEJunction *moved)
try to merge moved junction with another junction in that spot return true if merging did take place ...
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
mode for editing additional
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)
FXbool makeCurrent()
A reimplementation due to some internal reasons.
long onCmdOK(FXObject *, FXSelector, void *)
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
AddAdditionalResult addAdditional(GNENetElement *netElement, GUISUMOAbstractView *parent)
add additional element
AddAdditionalResult
FOX-declaration.
static const RGBColor YELLOW
static const RGBColor RED
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)
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
void moveAdditionalGeometry(const Position &offset)
change the position of the additional geometry
static const RGBColor CYAN
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void show()
show additional frame and update use selected edges/lanes
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Position myMoveSrc
position from which to move edge geometry
long onCmdAddRestrictedLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for bikes.
FXMenuCheck * myMenuCheckShowBubbleOverJunction
show connection as buuble in "Move" mode.
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
An Element which don't belongs to GNENet but has influency in the simulation.
GNEConnectorFrame * getConnectorFrame() const
get frame for GNE_MODE_CONNECT
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
MFXCheckableButton * myEditModeConnection
chekable button for edit mode connection
bool showConnections()
show connections over junctions
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
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 move(Position pos)
reposition the node at pos and informs the edges
A storage for options typed value containers)
long onCmdAddRestrictedLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for buses.
long onCmdRemoveRestrictedLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for pedestrians
GNECrossingFrame * getCrossingFrame() const
get frame for GNE_MODE_CROSSING
void simplifyShape()
replace the current shape with a rectangle
void deleteSelectedAdditionals()
delete all currently selected additionals
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn't a marked element ...
void clear()
Clears the list of selected objects.
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
bool showGrid
Information whether a grid shall be shown.
show junctions as bubbles
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
Locate addtional structure - button.
long onCmdRestrictLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to pedestrians
const Position & getPosition() const
void updateModeSpecificControls()
updates mode specific controls
GUIGlID getGlID() const
Returns the numerical id of the object.
MFXCheckableButton * myEditModeCrossing
chekable button for edit mode crossing
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false)
return all additionals
mode for connecting lanes
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
void setStatusBarText(const std::string &text)
set staturBar text
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
void setEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end
Locate junction - button.
GUIPropertyScheme< RGBColor > GUIColorScheme
static const RGBColor selectionColor
color of selection
Mode for editing crossing.
GNEAttributeCarrier * getMarkedAttributeCarrier() const
returns marked atrribute carrier
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
mode for creating new edges
NBEdge * getNBEdge()
returns the internal NBEdge
std::vector< GNEJunction * > getJunctionNeighbours() const
return GNEJunction neighbours
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
GUIGlID getObjectUnderCursor()
returns the id of the object under the cursor using GL_SELECT
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 inspectMultisection(const std::vector< GNEAttributeCarrier *> &ACs)
Inspect the given multi-selection.
double ymax() const
Returns maximum y-coordinate.
GNEEdge * getEdgeAtCursorPosition(Position &pos)
try to retrieve an edge at the given position
long onCmdNodeReplace(FXObject *, FXSelector, void *)
replace node by geometry
void hotkeyDel()
handle del keypress
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
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.
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
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
GUISelectedStorage gSelected
A global holder of selected objects.
GNENet * myNet
we are not responsible for deletion
void hotkeyEnter()
handle enter keypress
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
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 *)
called when user press the button for create edge mode
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
transform lane to busLane
bool addRestrictedLane(SUMOVehicleClass vclass)
add restricted lane
std::vector< GUIGlID > getObjectsInBoundary(const Boundary &bound)
returns the ids of all objects in the given boundary
FXPopup * getLocatorPopup()
GNEFrame * myCurrentFrame
the current frame
void deleteGeometryNear(const Position &pos)
delete the geometry point closest to the given pos
GNEPoly * myPolyToMove
the poly of which geometry is being moved
void finishMoveSelection(GNEUndoList *undoList)
register changes to junction and edge positions with the undoList
SumoXMLTag getTag() const
get XML Tag assigned to this object
virtual Position getPositionInView() const =0
Returns position of additional in view.