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());
170 i->setSpecialColor(
nullptr);
173 myCandidateLanes.clear();
176 i.first->setSpecialColor(
nullptr);
179 mySelectedLanes.clear();
191 if(lane ==
nullptr) {
196 if (i.first == lane) {
202 if(mySelectedLanes.size() > 0) {
218 i->setSpecialColor(
nullptr);
222 myCandidateLanes.clear();
226 if((lane == i->getLaneFrom()) && (!
isLaneSelected(i->getLaneTo()))) {
229 myCandidateLanes.push_back(i->getLaneTo());
266 const std::vector<std::pair<GNELane*, double> >&
289 if (i.first == lane) {
348 for (
auto i : listOfTags) {
349 if (i == additionalType) {
414 std::vector<std::string> vectorOfIds;
419 for (
auto i : selectedEdges) {
420 vectorOfIds.push_back(i->getID());
424 for (
int i = 0; i <
myList->getNumItems(); i++) {
425 if (
myList->isItemSelected(i)) {
426 vectorOfIds.push_back(
myList->getItem(i)->getText().text());
442 for (
auto i : vectorOfEdges) {
444 if (i->getID().find(search) != std::string::npos) {
445 myList->appendItem(i->getID().c_str());
513 for (
int i = 0; i <
myList->getNumItems(); i++) {
514 if (
myList->getItem(i)->isSelected()) {
524 for (
int i = 0; i <
myList->getNumItems(); i++) {
525 if (
myList->getItem(i)->isSelected()) {
569 std::vector<std::string> vectorOfIds;
574 for (
auto i : selectedLanes) {
575 vectorOfIds.push_back(i->getID());
579 for (
int i = 0; i <
myList->getNumItems(); i++) {
580 if (
myList->isItemSelected(i)) {
581 vectorOfIds.push_back(
myList->getItem(i)->getText().text());
593 for (
auto i : vectorOfLanes) {
594 if (i->getID().find(search) != std::string::npos) {
595 myList->appendItem(i->getID().c_str());
659 for (
int i = 0; i <
myList->getNumItems(); i++) {
660 if (
myList->getItem(i)->isSelected()) {
670 for (
int i = 0; i <
myList->getNumItems(); i++) {
671 if (
myList->getItem(i)->isSelected()) {
685 GNEFrame(horizontalFrameParent, viewNet,
"Additionals") {
749 if(tagValues.canBePlacedOverEdge()) {
751 }
else if(tagValues.canBePlacedOverLane()) {
753 }
else if(tagValues.canBePlacedOverLanes()) {
855 return tagProperties.getTagStr() +
"_" +
toString(additionalIndex);
883 double end = GNEAttributeCarrier::parse<double>(valuesMap[
SUMO_ATTR_END]);
956 if (lane !=
nullptr) {
992 if(lane ==
nullptr) {
1007 std::vector<std::string> laneIDs;
1009 laneIDs.push_back(i.first->getID());
void hideSelectorAdditionalParentModul()
hide SelectorAdditionalParent Modul
void enableModuls(const GNEAttributeCarrier::TagProperties &tagProperties)
enable moduls depending of item selected in ItemSelector
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
void hideNeteditAttributesModul()
hide Netedit attributes modul
SumoXMLTag
Numbers representing SUMO-XML - element names.
SelectorEdgeChilds()
FOX needs this.
bool showSelectorAdditionalParentModul(SumoXMLTag additionalTypeParent)
Show list of SelectorAdditionalParent Modul.
clear selection of elements
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
void hideSelectorLaneChildsModul()
hide SelectorLaneChilds Modul
~SelectorEdgeChilds()
destructor
std::map< SumoXMLAttr, std::string > getAttributesAndValues() const
get attributes and their values
invert selection of eleents
void hideSelectorEdgeChildsModul()
hide SelectorEdgeChilds Modul
const RGBColor & getSelectedLaneColor() const
get selected lane color
begin/end of the description of a single lane
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additional frame parent
void showSelectorLaneParentsModul()
show SelectorLaneParents modul
long onCmdUseSelectedEdges(FXObject *, FXSelector, void *)
FXButton * myInvertEdgesSelection
button for invert selection
A calibrator placed over edge.
FXTextField * myEdgesSearch
text field for search edge IDs
SumoXMLTag myAdditionalTypeParent
current additional type parent
void updateUseSelectedLanes()
bool buildAdditionalCommonAttributes(std::map< SumoXMLAttr, std::string > &valuesMap, const GNEAttributeCarrier::TagProperties &tagValues)
build common additional attributes
#define GUIDesignListSingleElement
design for FXLists that only allow a single selected elements
FXLabel * myFirstAdditionalParentsLabel
Label with the name of additional.
struct with the attribute Properties
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
FXList * myList
List of SelectorLaneChilds.
long onCmdTypeInSearchBox(FXObject *, FXSelector, void *)
called when user type in search box
abort selection of consecutive egdes/lanes
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...
static std::vector< SumoXMLTag > allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables)
get tags of all editable element types using TagProperty Type (TAGPROPERTY_NETELEMENT, TAGPROPERTY_ADDITIONAL, etc.)
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
~SelectorAdditionalParent()
destructor
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.
bool stopConsecutiveLaneSelector()
stop selection of consecutive lanes
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...
void setIDSelected(const std::string &id)
select manually a element of the list
long onCmdClearSelection(FXObject *, FXSelector, void *)
called when clear selection button is pressed
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
const std::vector< GNEConnection * > & getGNEConnections()
returns a reference to the GNEConnection vector
void showSelectorLaneChildsModul(std::string search="")
Show list of SelectorLaneChilds Modul.
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
ACAttributes * myAdditionalAttributes
internal additional attributes
const std::vector< std::pair< GNELane *, double > > & getSelectedLanes() const
get current selected lanes
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
long onCmdInvertSelection(FXObject *, FXSelector, void *)
called when invert selection button is pressed
RGBColor myCandidateLaneColor
color for candidate lanes
FXList * myFirstAdditionalParentsList
List of additional sets.
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)
#define WRITE_WARNING(msg)
GNEAdditionalFrame * myAdditionalFrameParent
pointer to Additional Frame Parent
void showSelectorEdgeChildsModul(std::string search="")
Show SelectorEdgeChilds Modul.
bool hasParent() const
return true if tag correspond to an element that can had another element as parent ...
FXButton * invertLanesSelection
button for invert selection
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
GNEViewNet * myViewNet
View Net for changes.
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
std::string getLaneIdsSelected() const
get list of selecte lane ids in string format
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
bool isLaneSelected(GNELane *lane) const
check if certain lane is selected
GNEUndoList * getUndoList() const
get the undoList object
long onCmdUseSelectedLanes(FXObject *, FXSelector, void *)
static const RGBColor GREEN
#define GUIDesignList
design for FXLists
GNEAdditionalFrame::SelectorLaneParents * getConsecutiveLaneSelector() const
getConsecutive Lane Selector
bool addAdditional(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
add additional element
#define GUIDesignTextField
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.
GNEEdge & getParentEdge()
Returns underlying parent edge.
void removeLastSelectedLane()
remove last added point
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.
SelectorLaneChilds * mySelectorLaneChilds
Modul for select lane childs.
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
long onCmdSelectEdge(FXObject *, FXSelector, void *)
called when user select a edge of the list
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additionalFrameParent
FXButton * myStopSelectingButton
button for stop selecting
bool buildAdditionalOverLane(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over a single lane
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
C++ TraCI client API implementation.
void showACAttributesModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show ACAttributes modul
bool canBePlacedOverEdges() const
return true if tag correspond to an element that can be placed over a list of edges ...
~GNEAdditionalFrame()
Destructor.
double getLengthGeometryFactor() const
get lenght geometry factor
void showSelectorLaneChildsModul()
show selector lane child and update use selected edges/lanes
FXCheckButton * myUseSelectedEdgesCheckButton
CheckBox for selected edges.
FXList * myList
List of SelectorEdgeChilds.
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
FXButton * myAbortSelectingButton
button for abort selecting
const std::string getID() const
function to support debugging
std::vector< std::pair< GNELane *, double > > mySelectedLanes
Vector with the selected lanes and the clicked position.
void refreshSelectorAdditionalParentModul()
Refresh list of Additional Parents Modul.
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane) const
fill valuesMap with netedit attributes
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
begin/end of the description of an edge
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn't)
FXTextField * myLanesSearch
text field for search lane IDs
~SelectorLaneChilds()
destructor
#define GUIDesignTextFieldNCol
Num of column of text field.
FXButton * clearLanesSelection
button for clear selection
const PositionVector & getShape() const
returns the shape of the lane
virtual void show()
show Frame
ItemSelector * myItemSelector
item selector
bool addSelectedLane(GNELane *lane, const Position &clickedPosition)
return true if lane can be selected as consecutive lane
long onCmdSelectLane(FXObject *, FXSelector, void *)
called when user select a lane of the list
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.
static GNEAdditional * buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, std::map< SumoXMLAttr, std::string > values)
Build additionals.
SelectorLaneChilds()
FOX needs this.
SelectorAdditionalParent(GNEAdditionalFrame *additionalFrameParent)
constructor
const std::string & getTagStr() const
get tag assigned to this object in string format
void disableModuls()
disable moduls if element selected in itemSelector isn't valid
FXDEFMAP(GNEAdditionalFrame::SelectorLaneParents) ConsecutiveLaneSelectorMap[]
void setSpecialColor(const RGBColor *Color2)
NeteditAttributes * myNeteditAttributes
Netedit parameter.
FXCheckButton * myUseSelectedLanesCheckButton
CheckBox for selected lanes.
SelectorLaneParents * mySelectorLaneParents
Modul for select lane parents (currently only consecutives)
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
virtual void hide()
hide Frame
std::string getEdgeIdsSelected() const
get list of selecte id's in string format
std::string generateID(GNENetElement *netElement) const
generate a ID for an additiona element
GNENet * getNet() const
get the net object
const std::map< std::string, GNEAdditional * > & getAdditionalByType(SumoXMLTag type) const
get map with IDs and pointers to additionals
bool buildAdditionalWithParent(std::map< SumoXMLAttr, std::string > &valuesMap, GNEAdditional *parent, const GNEAttributeCarrier::TagProperties &tagValues)
build additional with Parent
SelectorAdditionalParent * mySelectorAdditionalParent
Modul for select a single additional parent (Used only for first Additional 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
void updateUseSelectedEdges()
Update use selectedEdges.
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
GNEAdditionalFrame * myAdditionalFrameParent
pointer to additional frame parent
std::string getIdSelected() const
get currently additional parent selected
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.
bool areValuesValid() const
check if parameters of attributes are valid
bool buildAdditionalOverLanes(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane, const GNEAttributeCarrier::TagProperties &tagValues)
build additional over lanes
parent of an additional element
used to select a type of element in a combo box
FXButton * myClearEdgesSelection
button for clear selection
SelectorEdgeChilds * mySelectorEdgeChilds
Modul for select edge childs.
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
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
void setCurrentTypeTag(SumoXMLTag typeTag)
set current type manually
void abortConsecutiveLaneSelector()
abort selection of consecutive lanes
void hideACAttributesModul()
hide group box
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left and height of 23 ...
bool canBePlacedOverLanes() const
return true if tag correspond
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
~SelectorLaneParents()
destructor
stop selection of consecutive egdes/lanes