74 myAdditionalFrameParent(additionalFrameParent) {
79 myStopSelectingButton->disable();
80 myAbortSelectingButton->disable();
82 myCandidateLaneColor =
RGBColor(0, 64, 0, 255);
139 std::vector<std::string> laneIDs;
141 laneIDs.push_back(i.first->getID());
175 i->setSpecialColor(
nullptr);
178 myCandidateLanes.clear();
181 i.first->setSpecialColor(
nullptr);
184 mySelectedLanes.clear();
196 if (lane ==
nullptr) {
201 if (i.first == lane) {
207 if (mySelectedLanes.size() > 0) {
223 i->setSpecialColor(
nullptr);
227 myCandidateLanes.clear();
231 if ((lane == i->getLaneFrom()) && (!
isLaneSelected(i->getLaneTo()))) {
234 myCandidateLanes.push_back(i->getLaneTo());
271 const std::vector<std::pair<GNELane*, double> >&
294 if (i.first == lane) {
336 std::vector<std::string> vectorOfIds;
341 for (
auto i : selectedEdges) {
342 vectorOfIds.push_back(i->getID());
346 for (
int i = 0; i <
myList->getNumItems(); i++) {
347 if (
myList->isItemSelected(i)) {
348 vectorOfIds.push_back(
myList->getItem(i)->getText().text());
364 for (
auto i : vectorOfEdges) {
366 if (i->getID().find(search) != std::string::npos) {
367 myList->appendItem(i->getID().c_str());
435 for (
int i = 0; i <
myList->getNumItems(); i++) {
436 if (
myList->getItem(i)->isSelected()) {
446 for (
int i = 0; i <
myList->getNumItems(); i++) {
447 if (
myList->getItem(i)->isSelected()) {
491 std::vector<std::string> vectorOfIds;
496 for (
auto i : selectedLanes) {
497 vectorOfIds.push_back(i->getID());
501 for (
int i = 0; i <
myList->getNumItems(); i++) {
502 if (
myList->isItemSelected(i)) {
503 vectorOfIds.push_back(
myList->getItem(i)->getText().text());
515 for (
auto i : vectorOfLanes) {
516 if (i->getID().find(search) != std::string::npos) {
517 myList->appendItem(i->getID().c_str());
581 for (
int i = 0; i <
myList->getNumItems(); i++) {
582 if (
myList->getItem(i)->isSelected()) {
592 for (
int i = 0; i <
myList->getNumItems(); i++) {
593 if (
myList->getItem(i)->isSelected()) {
607 GNEFrame(horizontalFrameParent, viewNet,
"Additionals") {
757 return netElement->
getID();
763 return tagProperties.getTagStr() +
"_" + netElement->
getID() +
"_" +
toString(additionalIndex);
770 return tagProperties.getTagStr() +
"_" +
toString(additionalIndex);
798 double end = GNEAttributeCarrier::parse<double>(valuesMap[
SUMO_ATTR_END]);
876 if (lane !=
nullptr) {
917 if (lane ==
nullptr) {
932 std::vector<std::string> laneIDs;
934 laneIDs.push_back(i.first->getID());
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
FXTextField * myEdgesSearch
text field for search edge IDs
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
clear selection of elements
FXButton * invertLanesSelection
button for invert selection
PositionVector shape
The shape of the netElement element.
invert selection of eleents
const RGBColor & getSelectedLaneColor() const
get selected lane color
void updateUseSelectedLanes()
FXTextField * myLanesSearch
text field for search lane IDs
void hideAttributesCreatorModul()
hide group box
GNEFrameAttributesModuls::AttributesCreator * myAdditionalAttributes
internal additional attributes
begin/end of the description of a single lane
void update() const
Mark the entire GNEViewNet to be repainted later.
void showSelectorLaneParentsModul()
show SelectorLaneParents modul
bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add additional element
GNEFrameModuls::TagSelector * myAdditionalTagSelector
item selector
FXCheckButton * myUseSelectedLanesCheckButton
CheckBox for selected lanes.
A calibrator placed over edge.
an e2 detector over multiple lanes (used by Netedit)
SelectorEdgeChildren()
FOX needs this.
bool showSelectorParentModul(SumoXMLTag additionalTypeParent)
Show list of SelectorParent Modul.
bool buildAdditionalCommonAttributes(std::map< SumoXMLAttr, std::string > &valuesMap, const GNEAttributeCarrier::TagProperties &tagValues)
build common additional attributes
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show AttributesCreator modul
struct with the attribute Properties
FXCheckButton * myUseSelectedEdgesCheckButton
CheckBox for selected edges.
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
abort selection of consecutive egdes/lanes
void setIDSelected(const std::string &id)
select manually a element of the list
bool isShown() const
return true if modul is shown
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
long onCmdAbortSelection(FXObject *, FXSelector, void *)
Called when the user press abort selection button.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
bool stopConsecutiveLaneSelector()
stop selection of consecutive lanes
void hideNeteditAttributesModul()
hide Netedit attributes modul
SelectorLaneChildren()
FOX needs this.
long onCmdStopSelection(FXObject *, FXSelector, void *)
std::vector< GNELane * > myCandidateLanes
Vector with the colored lanes.
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
long onCmdTypeInSearchBox(FXObject *, FXSelector, void *)
called when user type in search box
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
long onCmdUseSelectedLanes(FXObject *, FXSelector, void *)
Encapsulated Xerces-SAX-attributes.
void hideSelectorLaneChildrenModul()
hide SelectorLaneChildren Modul
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
const std::vector< std::pair< GNELane *, double > > & getSelectedLanes() const
get current selected lanes
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additional frame parent
RGBColor myCandidateLaneColor
color for candidate lanes
static bool buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Build additionals.
GNEViewNet * getViewNet() const
get view net
bool buildAdditionalOverEdge(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over an edge (parent of lane)
const std::map< int, std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
#define WRITE_WARNING(msg)
bool areValuesValid() const
check if parameters of attributes are valid
bool hasParent() const
return true if tag correspond to an element that can had another element as parent ...
GNEViewNet * myViewNet
View Net.
FXButton * clearLanesSelection
button for clear selection
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
#define GUIDesignListFixedHeight
design for FXLists with height fixed
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additional frame parent
bool isLaneSelected(GNELane *lane) const
check if certain lane is selected
static const RGBColor GREEN
GNEAdditionalFrame::SelectorLaneParents * getConsecutiveLaneSelector() const
getConsecutive Lane Selector
#define GUIDesignTextField
void showSelectorEdgeChildrenModul(std::string search="")
Show SelectorEdgeChildren Modul.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
void updateUseSelectedEdges()
Update use selectedEdges.
GNEEdge & getParentEdge()
Returns underlying parent edge.
void removeLastSelectedLane()
remove last added point
A point in 2D or 3D with translation and scaling methods.
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
std::string getIdSelected() const
get currently additional parent selected
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additionalFrameParent
FXButton * myStopSelectingButton
button for stop selecting
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
bool buildAdditionalOverLane(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over a single lane
C++ TraCI client API implementation.
FXButton * myClearEdgesSelection
button for clear selection
~GNEAdditionalFrame()
Destructor.
class used to group all variables related with objects under cursor after a click over view ...
double getLengthGeometryFactor() const
get length geometry factor
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
long onCmdSelectLane(FXObject *, FXSelector, void *)
called when user select a lane of the list
FXButton * myAbortSelectingButton
button for abort selecting
const std::string getID() const
function to support debugging
const NetElementGeometry & getGeometry() const
std::vector< std::pair< GNELane *, double > > mySelectedLanes
Vector with the selected lanes and the clicked position.
GNEFrameModuls::SelectorParent * myAdditionalParent
Modul for select a single additional parent.
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn't)
FXButton * myInvertEdgesSelection
button for invert selection
void hideSelectorEdgeChildrenModul()
hide SelectorEdgeChildren Modul
void setSpecialColor(const RGBColor *Color2, double colorValue=std::numeric_limits< double >::max())
void refreshSelectorParentModul()
Refresh list of Additional Parents Modul.
begin/end of the description of an edge
SelectorLaneChildren * mySelectorLaneChildren
Modul for select lane children.
void tagSelected()
Tag selected in TagSelector.
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, const GNELane *lane) const
fill valuesMap with netedit attributes
FXList * myList
List of SelectorLaneChildren.
#define GUIDesignTextFieldNCol
Num of column of text field.
FXList * myList
List of SelectorEdgeChildren.
void showSelectorLaneChildrenModul()
show selector lane child and update use selected edges/lanes
virtual void show()
show Frame
long onCmdTypeInSearchBox(FXObject *, FXSelector, void *)
called when user type in search box
bool addSelectedLane(GNELane *lane, const Position &clickedPosition)
return true if lane can be selected as consecutive lane
std::string getLaneIdsSelected() const
get list of selecte lane ids in string format
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
std::string getEdgeIdsSelected() const
get list of selecte id's in string format
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
FXDEFMAP(GNEAdditionalFrame::SelectorLaneParents) ConsecutiveLaneSelectorMap[]
~SelectorEdgeChildren()
destructor
SelectorLaneParents * mySelectorLaneParents
Modul for select lane parents (currently only consecutives)
SelectorEdgeChildren * mySelectorEdgeChildren
Modul for select edge children.
RGBColor mySelectedLaneColor
color for selected lanes
bool buildAdditionalOverView(std::map< SumoXMLAttr, std::string > &valuesMap, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over view
void hideSelectorLaneParentsModul()
hide SelectorLaneParents
std::string generateID(GNENetElement *netElement) const
generate a ID for an additiona element
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
GNENet * getNet() const
get the net object
bool buildAdditionalWithParent(std::map< SumoXMLAttr, std::string > &valuesMap, GNEAdditional *parent, const GNEAttributeCarrier::TagProperties &tagValues)
build additional with Parent
void setStatusBarText(const std::string &text)
set staturBar text
bool isSelectingLanes() const
return true if modul is selecting lane
SumoXMLTag getParentTag() const
if Tag owns a parent, return parent tag
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
void startConsecutiveLaneSelector(GNELane *lane, const Position &clickedPosition)
start selection of consecutive lanes
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
bool buildAdditionalOverLanes(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over lanes
parent of an additional element
void setCurrentTag(SumoXMLTag newTag)
set current type manually
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
void hideSelectorParentModul()
hide SelectorParent Modul
~SelectorLaneChildren()
destructor
long onCmdSelectEdge(FXObject *, FXSelector, void *)
called when user select a edge of the list
GNEAdditionalFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void showSelectorLaneChildrenModul(std::string search="")
Show list of SelectorLaneChildren Modul.
void abortConsecutiveLaneSelector()
abort selection of consecutive lanes
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
~SelectorLaneParents()
destructor
stop selection of consecutive egdes/lanes