82 #ifdef CHECK_MEMORY_LEAKS 84 #endif // CHECK_MEMORY_LEAKS 133 FXGLVisual* glVis, FXGLCanvas* share, FXToolBar* toolBar) :
134 GUISUMOAbstractView(tmpParent, app, viewParent, net->getVisualisationSpeedUp(), glVis, share),
135 myViewParent(viewParent),
138 myPreviousEditMode(GNE_MODE_MOVE),
139 myShowConnectionActivated(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);
312 "\tLocate Junction\tLocate a junction within the network.",
314 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
317 "\tLocate Street\tLocate a street within the network.",
319 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
322 "\tLocate TLS\tLocate a traffic light within the network.",
324 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
396 glMatrixMode(GL_MODELVIEW);
398 glDisable(GL_TEXTURE_2D);
399 glDisable(GL_ALPHA_TEST);
401 glEnable(GL_DEPTH_TEST);
406 glTranslated(0, 0,
GLO_MAX - 1);
409 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
441 glTranslated(center.
x(), center.
y(),
GLO_MAX - 1);
442 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
445 glVertex2d(0, -size);
446 glVertex2d(size, -size);
456 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
457 const float minB[2] = { (float)bound.
xmin(), (float)bound.
ymin() };
458 const float maxB[2] = { (float)bound.
xmax(), (float)bound.
ymax() };
460 glEnable(GL_POLYGON_OFFSET_FILL);
461 glEnable(GL_POLYGON_OFFSET_LINE);
476 FXEvent* e = (FXEvent*) data;
497 pointed_edge = (
GNEEdge*)pointed;
500 pointed_lane = (
GNELane*)pointed;
504 pointed_poi = (
GNEPOI*)pointed;
507 pointed_poly = (
GNEPoly*)pointed;
527 if ((e->state & CONTROLMASK) == 0) {
532 if (!pointed_junction) {
553 std::cout <<
"edge created without an open CommandGroup )-:\n";
578 }
else if (pointed_poi) {
581 }
else if (pointed_junction) {
588 }
else if (pointed_edge) {
595 }
else if (pointed_additional) {
638 bool markElementMode = (((FXEvent*)data)->state & CONTROLMASK) != 0;
642 if (markElementMode) {
661 if (pointed_junction) {
662 pointedAC = pointed_junction;
663 pointedO = pointed_junction;
664 }
else if (pointed_lane) {
666 pointedAC = pointed_edge;
667 pointedO = pointed_edge;
669 pointedAC = pointed_lane;
670 pointedO = pointed_lane;
672 }
else if (pointed_edge) {
673 pointedAC = pointed_edge;
674 pointedO = pointed_edge;
675 }
else if (pointed_crossing) {
676 pointedAC = pointed_crossing;
677 pointedO = pointed_crossing;
678 }
else if (pointed_additional) {
679 pointedAC = pointed_additional;
680 pointedO = pointed_additional;
681 }
else if (pointed_connection) {
682 pointedAC = pointed_connection;
683 pointedO = pointed_connection;
686 std::vector<GNEAttributeCarrier*> selected;
690 }
else if (pointedAC != 0) {
691 selected.push_back(pointedAC);
702 }
else if (pointed) {
718 const bool mayPass = (((FXEvent*)data)->state & SHIFTMASK) != 0;
719 const bool allowConflict = (((FXEvent*)data)->state & CONTROLMASK) != 0;
727 if (pointed_junction) {
735 if (pointed_additional == NULL) {
745 if (pointed_crossing == NULL) {
797 if (((FXEvent*)data)->state & SHIFTMASK) {
824 if (pointed_additional != NULL) {
896 if (clearSelection) {
970 FXMessageBox::error(
this, MBOX_OK,
"invalid edit mode",
"%s",
"...");
1048 edge = &(((
GNELane*)pointed)->getParentEdge());
1078 std::set<GNEEdge*> result;
1081 for (std::vector<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); ++it) {
1087 result.insert((
GNEEdge*)pointed);
1090 result.insert(&(((
GNELane*)pointed)->getParentEdge()));
1178 if (edges.size() != 0) {
1232 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
1273 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1348 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1350 for (std::vector<GNELane*>::iterator i = lanes.begin(); i != lanes.end(); i++) {
1354 if (mapOfEdgesAndLanes.size() != lanes.size()) {
1355 FXMessageBox::information(getApp(), MBOX_OK,
1356 "Multiple lane in the same edge selected",
"%s",
1357 (
"There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " +
toString(vclass) +
".").c_str());
1360 if (mapOfEdgesAndLanes.size() > 0) {
1364 for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
1365 if (i->first->hasRestrictedLane(vclass)) {
1370 if (counter == (
int)mapOfEdgesAndLanes.size()) {
1371 FXMessageBox::information(getApp(), MBOX_OK,
1372 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1373 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1377 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1378 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1379 (
toString(mapOfEdgesAndLanes.size() - counter) +
" lanes will be restricted for " +
toString(vclass) +
". continue?").c_str());
1387 for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
1415 std::set<GNEEdge*> setOfEdges;
1417 for (std::vector<GNEEdge*>::iterator i = edges.begin(); i != edges.end(); i++) {
1418 setOfEdges.insert(*i);
1421 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1426 if (setOfEdges.size() > 0) {
1430 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1432 if ((*it)->hasRestrictedLane(vclass) ==
true) {
1437 if (counter == (
int)setOfEdges.size()) {
1438 FXMessageBox::information(getApp(), MBOX_OK,
1439 (
"Add vclass for" +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1440 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1444 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1445 (
"Add vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1446 (
toString(setOfEdges.size() - counter) +
" restrictions for " +
toString(vclass) +
" will be added. continue?").c_str());
1454 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1482 std::set<GNEEdge*> setOfEdges;
1484 for (std::vector<GNEEdge*>::iterator i = edges.begin(); i != edges.end(); i++) {
1485 setOfEdges.insert(*i);
1488 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1493 if (setOfEdges.size() > 0) {
1497 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1499 if ((*it)->hasRestrictedLane(vclass) ==
true) {
1505 FXMessageBox::information(getApp(), MBOX_OK,
1506 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1507 (
"Selected lanes and edges haven't a restriction for " +
toString(vclass)).c_str());
1511 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1512 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1513 (
toString(counter) +
" restrictions for " +
toString(vclass) +
" will be removed. continue?").c_str());
1521 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1545 std::vector<GNELane*> lanes;
1551 for (std::vector<GNEEdge*>::iterator i = edges.begin(); i != edges.end(); i++) {
1552 for (std::vector<GNELane*>::const_iterator j = (*i)->getLanes().begin(); j != (*i)->getLanes().end(); j++) {
1553 lanes.push_back(*j);
1561 if (lanes.size() > 0) {
1565 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1572 FXMessageBox::information(getApp(), MBOX_OK,
1573 "Revert restriction",
"%s",
1574 "None of selected lanes has a previous restriction");
1578 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1579 "Revert restriction",
"%s",
1580 (
toString(counter) +
" restrictions of lanes lanes will be reverted. continue?").c_str());
1588 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1610 if (junction != 0) {
1653 if (junction != 0) {
1746 myChainCreateEdge =
new FXMenuCheck(
myToolbar,
"chain\t\tCreate consecutive edges with a single click (hit ESC to cancel chain).",
this, 0);
1748 mySelectEdges =
new FXMenuCheck(
myToolbar,
"select edges\t\tToggle whether clicking should select edges or lanes",
this, 0);
1754 myExtendToEdgeNodes =
new FXMenuCheck(
myToolbar,
"auto-select junctions\t\tToggle whether selecting multiple edges should automatically select their junctions",
this, 0);
1756 myWarnAboutMerge =
new FXMenuCheck(
myToolbar,
"ask for merge\t\tAsk for confirmation before merging junctions.",
this, 0);
1762 myChangeAllPhases =
new FXMenuCheck(
myToolbar,
"apply change to all phases\t\tToggle whether clicking should apply state changes to all phases of the current traffic light plan",
this, 0);
1884 for (std::vector<GNEJunction*>::iterator it = junctions.begin(); it != junctions.end(); it++) {
1896 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
1902 for (std::vector<GNELane*>::iterator it = lanes.begin(); it != lanes.end(); it++) {
1917 selection.
add(newPos);
1918 selection.
grow(0.1);
1921 for (std::vector<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
1939 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
1940 "Confirm Junction Merger",
"%s",
1941 (
"Do you wish to merge junctions '" + moved->
getMicrosimID() +
1944 "' will be eliminated and its roads added to '" +
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
EditMode getCurrentEditMode() const
get the current edit mode
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
long onCmdRestrictLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to bikes
static const RGBColor BLUE
bool showLockIcon() const
check if lock icon should be visible
Position moveGeometry(const Position &oldPos, const Position &newPos, bool relative=false)
draw the polygon and also little movement handles
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< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
FXMenuCheck * mySelectEdges
menu check to select only edges
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 setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position myPopupSpot
Poput spot.
GUICompleteSchemeStorage gSchemeStorage
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
void abortOperation(bool clearSelection=true)
abort current edition operation
void deleteSelectedJunctions()
delete all currently selected junctions
const SUMOReal SUMO_const_laneWidth
bool setColorScheme(const std::string &name)
set color schieme
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
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void move(Position pos)
reposition the POI at pos and informs the edges
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
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
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
The main window of the Netedit.
SUMORTree * myGrid
The visualization speed-up.
long onCmdSetModeSelect(FXObject *, FXSelector, void *)
called when user press the button for select mode
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
void setAllowsNegativeValues(bool value)
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
FXMenuCheck * myShowConnections
menu check to show connections
SUMOReal ymin() const
Returns minimum y-coordinate.
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
void updateCurrentLabel(GNEAttributeCarrier *ac)
update current label
const PositionVector & getShape() const
Returns whether the shape of the polygon.
GUIMainWindow * myApp
The application.
FXMenuCheck * myChangeAllPhases
menu check to set change all phases
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
SUMOReal xmin() const
Returns minimum x-coordinate.
Position mySelCorner2
second corner of the rectangle-selection
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
classes which (normally) do not drive on normal roads
void removeAdditionalGLObject(GUIGlObject *o)
Removes an additional object (detector/shape/trigger) from being visualised.
mode for editing crossing
NBNode * getNBNode() const
Return net build node.
show junctions as bubbles
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
virtual Position getPositionInView() const =0
Returns position of additional in view.
void setSelectionScaling(SUMOReal selectionScale)
set selection scaling
SUMOReal p2m(SUMOReal pixel) const
pixels-to-meters conversion method
void setLineWidth(SUMOReal lineWidth)
set a new shape and update the tesselation
long onCmdNodeShape(FXObject *, FXSelector, void *)
input custom node shape
static const RGBColor ORANGE
std::string getAttribute(SumoXMLAttr key) const
MFXCheckableButton * myEditModeMove
chekable button for edit mode move
virtual long onLeftBtnPress(FXObject *, FXSelector, void *)
void splitEdgesBidi(const std::set< GNEEdge * > &edges, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
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 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...
transform lane to busLane
GNEPOI * myPoiToMove
the poi which is being moved
void setEditModeFromHotkey(FXushort selid)
sets edit mode (from hotkey)
bool addAdditional(GNENetElement *netElement, GUISUMOAbstractView *parent)
add additional element
long onCmdSetEdgeEndpoint(FXObject *, FXSelector, void *)
set non-default geometry endpoint
static const RGBColor BLACK
const SVCPermissions SVCAll
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
GNEViewParent * getViewParent() const
get the net object
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList)
removes edge
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
Locate junction - button.
SUMOReal x() const
Returns the x-position.
FXMenuCheck * myShowBubbleOverJunction
show connection as buuble in "Move" mode.
GUIGlID getGlID() const
Returns the numerical id of the object.
SUMOReal xmax() const
Returns maximum x-coordinate.
GNEEdge * myEdgeToMove
the edge of which geometry is being moved
A class that stores a 2D geometrical boundary.
bool myShowConnectionActivated
whether show connections has been activated once
A single child window which contains a view of the simulation area.
static OptionsCont & getOptions()
Retrieves the options.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
Position screenPos2NetPos(int x, int y) const
Translate screen position to network position.
transform lane to bikelane
GNEUndoList * getUndoList() const
get the undoList object
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
bool myMoveSelection
whether a selection is being moved
long onCmdSetModeCrossing(FXObject *, FXSelector, void *)
called when user press the button for crossing mode
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
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.
std::vector< GUIGlID > getObjectsAtPosition(Position pos, SUMOReal radius)
returns the ids of the object at position within the given (rectangular) radius using GL_SELECT ...
void insert(const std::string str, const T key, bool checkDuplicates=true)
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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
long onLeftBtnPress(FXObject *, FXSelector, void *)
const Position & getPosition() const
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
int addColor(const T &color, const SUMOReal threshold, const std::string &name="")
static const RGBColor GREEN
static const RGBColor GREY
virtual long onPaint(FXObject *, FXSelector, void *)
simplify polygon geometry
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
GNEPoly * myCurrentPoly
current polygon
SUMOReal selectionScale
the current selection scaling in NETEDIT (temporary)
long onCmdRemoveRestrictedLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for bus
set non-default geometry endpoint
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
FXMenuCheck * myWarnAboutMerge
whether we should warn about merging junctions
restore geometry endpoint to node position
mode for inspecting object attributes
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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
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 ~GNEViewNet()
destructor
long onCmdSetModeMove(FXObject *, FXSelector, void *)
called when user press the button for move mode
mode for inspecting object attributes
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.
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.
static int _str2int(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
turn junction into geometry node
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
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
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
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(const std::set< GUIGlID > &ids, GUIGlObjectType type)
get the attribute carriers based on GlIDs
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
GNEConnectorFrame * getConnectorFrame() const
get frame for GNE_MODE_CONNECT
void unMarkAsCreateEdgeSource()
removes mark as first junction in createEdge-mode
void moveSelection(const Position &moveSrc, const Position &moveDest)
move all selected junctions and edges
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
virtual std::string getAttribute(SumoXMLAttr key) const =0
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
const PositionVector & getShape() const
retrieve the junction shape
long onCmdRestrictLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to buslanes
bool myUseToolTips
use tool tips
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
vehicle is a passenger car (a "normal" car)
mode for connecting lanes
transform lane to sidewalk
void doInit()
called after some features are already initialized
begin/end of the description of an edge
FXMenuCheck * myAutoCreateOppositeEdge
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
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 *)
static const RGBColor YELLOW
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
mode for editing additional
static const RGBColor RED
const PositionVector & getShape() const
returns the shape of the lane
FXMenuCheck * myExtendToEdgeNodes
menu check to extend to edge nodes
#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
bool hasCommandGroup() const
Check if undoList has command group.
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
void add(SUMOReal x, SUMOReal y, SUMOReal z=0)
Makes the boundary include the given coordinate.
long onCmdAddRestrictedLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for bikes.
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.
MFXCheckableButton * myEditModeConnection
chekable button for edit mode connection
bool showConnections()
show connections over junctions
SUMOReal m2p(SUMOReal meter) const
meter-to-pixels conversion method
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
SUMOReal y() const
Returns the y-position.
mode for selecting objects
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)
void set(SUMOReal x, SUMOReal y)
set positions x and y
long onCmdAddRestrictedLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for buses.
long onCmdRemoveRestrictedLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for pedestrians
GNEAttributeCarrier * getMarkedAttributeCarrier() const
returns marked atrribute carrier
void simplifyShape()
replace the current shape with a rectangle
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn't a marked element ...
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
void handleIDs(std::vector< GUIGlID > ids, bool selectEdges, SetOperation setop=SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
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.
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
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
SUMOReal ymax() const
Returns maximum y-coordinate.
GUIPropertyScheme< RGBColor > GUIColorScheme
static const RGBColor selectionColor
color of selection
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
mode for creating new edges
NBEdge * getNBEdge()
returns the internal NBEdge
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_MODE_TLS
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
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.
void closePolygon()
ensures that the last position equals the first
GNEJunction * getEditedJunction() const
retrieve the junction of which the shape is being edited
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
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
void computeNodeShape(SUMOReal mismatchThreshold)
Compute the junction shape for this node.
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
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()
bool myTestingMode
testing mode
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
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