88 GNEFrame(horizontalFrameParent, viewNet, "Selection") {
102 FXGroupBox* selectionHintGroupBox =
new FXGroupBox(myContentFrame,
"Information",
GUIDesignGroupBoxFrame);
104 new FXLabel(selectionHintGroupBox,
" - Hold <SHIFT> for \n rectangle selection.\n - Press <DEL> to\n delete selected items.",
nullptr,
GUIDesignLabelFrameInformation);
142 if (i.second->isAttributeCarrierSelected()) {
147 for (
const auto& j : i.second->getGNEIncomingEdges()) {
150 if (j->isAttributeCarrierSelected()) {
156 for (
auto k : j->getLanes()) {
157 if (k->isAttributeCarrierSelected()) {
164 for (
const auto& k : j->getGNEConnections()) {
165 if (k->isAttributeCarrierSelected()) {
173 for (
const auto& j : i.second->getGNECrossings()) {
174 if (j->isAttributeCarrierSelected()) {
185 for (
const auto& j : i.second) {
186 if (j.second->isAttributeCarrierSelected()) {
215 if (i.second->isAttributeCarrierSelected()) {
223 if (i.second->isAttributeCarrierSelected()) {
231 if (i.second->isAttributeCarrierSelected()) {
239 if (i.second->isAttributeCarrierSelected()) {
247 if (i.second->isAttributeCarrierSelected()) {
255 if (i.second->isAttributeCarrierSelected()) {
263 if (i.second->isAttributeCarrierSelected()) {
268 if (i.second->isAttributeCarrierSelected()) {
273 if (i.second->isAttributeCarrierSelected()) {
278 if (i.second->isAttributeCarrierSelected()) {
283 if (i.second->isAttributeCarrierSelected()) {
291 if (i.second->isAttributeCarrierSelected()) {
299 if (i.second->isAttributeCarrierSelected()) {
307 if (i.second->isAttributeCarrierSelected()) {
312 if (i.second->isAttributeCarrierSelected()) {
320 if (i.second->isAttributeCarrierSelected()) {
325 if (i.second->isAttributeCarrierSelected()) {
333 if (i.second->isAttributeCarrierSelected()) {
338 if (i.second->isAttributeCarrierSelected()) {
343 if (i.second->isAttributeCarrierSelected()) {
351 if (i.second->isAttributeCarrierSelected()) {
356 if (i.second->isAttributeCarrierSelected()) {
374 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToSelect;
375 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToUnselect;
381 for (
auto i : selectedAC) {
382 ACToUnselect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
388 switch (setOperation) {
390 ACToUnselect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
393 if (ACToUnselect.find(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i)) != ACToUnselect.end()) {
394 ACToSelect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
398 ACToSelect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
404 std::vector<GNEEdge*> edgesToSelect;
406 for (
auto i : ACToSelect) {
408 edgesToSelect.push_back(dynamic_cast<GNEEdge*>(i.second));
412 for (
auto i : edgesToSelect) {
414 ACToSelect.insert(std::make_pair(i->getGNEJunctionSource()->getID(), i->getGNEJunctionSource()));
415 for (
auto j : i->getGNEJunctionSource()->getGNEConnections()) {
416 ACToSelect.insert(std::make_pair(j->getID(), j));
418 for (
auto j : i->getGNEJunctionSource()->getGNECrossings()) {
419 ACToSelect.insert(std::make_pair(j->getID(), j));
422 ACToSelect.insert(std::make_pair(i->getGNEJunctionDestiny()->getID(), i->getGNEJunctionDestiny()));
423 for (
auto j : i->getGNEJunctionDestiny()->getGNEConnections()) {
424 ACToSelect.insert(std::make_pair(j->getID(), j));
426 for (
auto j : i->getGNEJunctionDestiny()->getGNECrossings()) {
427 ACToSelect.insert(std::make_pair(j->getID(), j));
432 if ((ACToSelect.size() + ACToUnselect.size()) > 0) {
435 for (
auto i : ACToUnselect) {
436 if (i.second->getTagProperty().isSelectable()) {
440 for (
auto i : ACToSelect) {
441 if (i.second->getTagProperty().isSelectable()) {
465 std::vector<GNEAttributeCarrier*>
467 std::vector<GNEAttributeCarrier*> result;
470 for (
auto it : allACbyTag) {
472 result.push_back(it);
473 }
else if (tagValue.hasAttribute(ACAttr) && tagValue.getAttributeProperties(ACAttr).isNumerical()) {
475 std::istringstream buf(it->getAttribute(ACAttr));
480 result.push_back(it);
485 result.push_back(it);
490 result.push_back(it);
496 std::string acVal = it->getAttributeForSelection(ACAttr);
499 if (acVal.find(expr) != std::string::npos) {
500 result.push_back(it);
504 if (acVal.find(expr) == std::string::npos) {
505 result.push_back(it);
510 result.push_back(it);
515 result.push_back(it);
530 mySelectorFrameParent(selectorFrameParent) {
562 delete i.second.second;
581 if ((type >= 100) && (type < 199)) {
594 i.second.second->showObjectTypeEntry();
596 i.second.second->hideObjectTypeEntry();
666 myModificationModeType(SET_ADD) {
668 myAddRadioButton =
new FXRadioButton(
this,
"add\t\tSelected objects are added to the previous selection",
670 myRemoveRadioButton =
new FXRadioButton(
this,
"remove\t\tSelected objects are removed from the previous selection",
672 myKeepRadioButton =
new FXRadioButton(
this,
"keep\t\tRestrict previous selection by the current selection",
674 myReplaceRadioButton =
new FXRadioButton(
this,
"replace\t\tReplace previous selection by the current selection",
730 mySelectorFrameParent(selectorFrameParent),
731 myCurrentElementSet(ELEMENTSET_NETELEMENT) {
844 std::vector<SumoXMLTag> listOfTags;
857 for (
auto i : listOfTags) {
886 std::vector<SumoXMLTag> listOfTags;
899 for (
auto i : listOfTags) {
914 for (
auto it : tagValue) {
920 if (tagValue.canBlockMovement()) {
924 if (tagValue.canBlockShape()) {
928 if (tagValue.canCloseShape()) {
932 if (tagValue.hasParent()) {
958 GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING,
959 "Generic Parameters");
960 tagPropertiesCopy.addAttribute(extraAttrProperty);
962 if (tagValue.canBlockMovement()) {
965 GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC,
968 tagPropertiesCopy.addAttribute(extraAttrProperty);
971 if (tagValue.canBlockShape()) {
974 GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC,
977 tagPropertiesCopy.addAttribute(extraAttrProperty);
980 if (tagValue.canCloseShape()) {
983 GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC,
986 tagPropertiesCopy.addAttribute(extraAttrProperty);
989 if (tagValue.hasParent()) {
992 GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING,
994 tagPropertiesCopy.addAttribute(extraAttrProperty);
998 for (
const auto& i : tagPropertiesCopy) {
1030 char compOp = expr[0];
1031 if (compOp ==
'<' || compOp ==
'>' || compOp ==
'=') {
1032 expr = expr.substr(1);
1037 if (GNEAttributeCarrier::canParse<double>(expr.c_str())) {
1049 char compOp = expr[0];
1050 if (compOp ==
'=' || compOp ==
'!' || compOp ==
'^') {
1051 expr = expr.substr(1);
1070 FXDialogBox* additionalNeteditAttributesHelpDialog =
new FXDialogBox(
this,
"Netedit Parameters Help",
GUIDesignDialogBox);
1073 std::ostringstream help;
1075 <<
"- The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection\n" 1076 <<
" according to the current 'Modification Mode'.\n" 1077 <<
" 1. Select an object type from the first input box\n" 1078 <<
" 2. Select an attribute from the second input box\n" 1079 <<
" 3. Enter a 'match expression' in the third input box and press <return>\n" 1081 <<
"- The empty expression matches all objects\n" 1082 <<
"- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n" 1083 <<
"- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n" 1085 <<
"- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n" 1086 <<
" '' (no operator) matches if string is a substring of that object'ts attribute.\n" 1087 <<
" '=' matches if string is an exact match.\n" 1088 <<
" '!' matches if string is not a substring.\n" 1089 <<
" '^' matches if string is not an exact match.\n" 1092 <<
" junction; id; 'foo' -> match all junctions that have 'foo' in their id\n" 1093 <<
" junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n" 1094 <<
" edge; speed; '>10' -> match all edges with a speed above 10\n";
1106 WRITE_DEBUG(
"Opening help dialog of selector frame");
1108 additionalNeteditAttributesHelpDialog->create();
1110 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
1112 getApp()->refresh();
1114 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
1116 WRITE_DEBUG(
"Close help dialog of selector frame");
1173 FXFileDialog opendialog(
this,
"Open List of Selected Items");
1175 opendialog.setSelectMode(SELECTFILE_EXISTING);
1176 opendialog.setPatternList(
"Selection files (*.txt)\nAll files (*)");
1180 if (opendialog.execute()) {
1181 std::vector<GNEAttributeCarrier*> loadedACs;
1183 std::string file = opendialog.getFilename().text();
1184 std::ostringstream msg;
1185 std::ifstream strm(file.c_str());
1191 while (strm.good()) {
1195 if (line.length() != 0) {
1207 loadedACs.push_back(AC);
1213 if (loadedACs.size() > 0) {
1242 WRITE_DEBUG(
"Opening FXMessageBox 'error storing selection'");
1244 FXMessageBox::error(
this, MBOX_OK,
"Storing Selection failed",
"%s", e.what());
1246 WRITE_DEBUG(
"Closed FXMessageBox 'error storing selection' with 'OK'");
1274 if (i.second->isAttributeCarrierSelected()) {
1281 for (
const auto& j : i.second->getGNEIncomingEdges()) {
1286 if (j->isAttributeCarrierSelected()) {
1295 for (
auto k : j->getLanes()) {
1296 if (k->isAttributeCarrierSelected()) {
1306 for (
const auto& k : j->getGNEConnections()) {
1307 if (k->isAttributeCarrierSelected()) {
1317 for (
const auto& j : i.second->getGNECrossings()) {
1318 if (j->isAttributeCarrierSelected()) {
1331 for (
const auto& j : i.second) {
1332 if (j.second->isAttributeCarrierSelected()) {
1367 if (i.second->isAttributeCarrierSelected()) {
1377 if (i.second->isAttributeCarrierSelected()) {
1387 if (i.second->isAttributeCarrierSelected()) {
1397 if (i.second->isAttributeCarrierSelected()) {
1407 if (i.second->isAttributeCarrierSelected()) {
1417 if (i.second->isAttributeCarrierSelected()) {
1427 if (i.second->isAttributeCarrierSelected()) {
1434 if (i.second->isAttributeCarrierSelected()) {
1441 if (i.second->isAttributeCarrierSelected()) {
1448 if (i.second->isAttributeCarrierSelected()) {
1455 if (i.second->isAttributeCarrierSelected()) {
1465 if (i.second->isAttributeCarrierSelected()) {
1475 if (i.second->isAttributeCarrierSelected()) {
1485 if (i.second->isAttributeCarrierSelected()) {
1492 if (i.second->isAttributeCarrierSelected()) {
1502 if (i.second->isAttributeCarrierSelected()) {
1509 if (i.second->isAttributeCarrierSelected()) {
1519 if (i.second->isAttributeCarrierSelected()) {
1526 if (i.second->isAttributeCarrierSelected()) {
1533 if (i.second->isAttributeCarrierSelected()) {
1543 if (i.second->isAttributeCarrierSelected()) {
1551 if (i.second->isAttributeCarrierSelected()) {
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
stop placed over a parking area (used in netedit)
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
~SelectionOperation()
destructor
void close()
Closes the device and removes it from the dictionary.
SumoXMLTag
Numbers representing SUMO-XML - element names.
#define GUIDesignComboBoxNCol
number of column of every combo box
~MatchAttribute()
destructor
long onCmdSetCheckBox(FXObject *, FXSelector, void *)
void addedLockedObject(const GUIGlObjectType type)
set object selected
FXRadioButton * myReplaceRadioButton
replace radio button
std::map< std::string, GNEEdge * > edges
map with the name and pointer to edges of net
void update() const
Mark the entire GNEViewNet to be repainted later.
FXComboBox * mySetComboBox
Combo Box with the element sets.
a flow definitio nusing a from-to edges instead of a route (used by router)
SetOperation getModificationMode() const
get current modification mode
block shape of a graphic element (Used mainly in GNEShapes)
void handleIDs(const std::vector< GNEAttributeCarrier *> &ACs, ModificationMode::SetOperation setop=ModificationMode::SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
FXLabel * myLabelCounter
label counter
const Polygons & getPolygons() const
Returns all polygons.
void hideObjectTypeEntry()
hide ObjectTypeEntry
bool isDemandElement() const
return true if tag correspond to a demand element
int size() const
Returns the number of stored items within the container.
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT) ...
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
SetOperation
FOX-declaration.
const std::string & getString(const T key) const
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
FXRadioButton * myAddRadioButton
add radio button
bool isSelectable() const
return true if tag correspond to a selectable element
FXLabel * myLabelTypeName
label type nane
Close shape of a polygon (Used by GNEPolys)
stop placed over a lane (used in netedit)
bool selectEdges() const
check if select edges checkbox is enabled
static std::vector< SumoXMLTag > allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables)
get tags of all editable element types using TagProperty Type (TAGTYPE_NETELEMENT, TAGTYPE_ADDITIONAL, etc.)
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...
FXString gCurrentFolder
The folder used as last.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
select tag in selector frame
void disableMatchAttribute()
disable match attributes
ElementSetType myCurrentElementSet
current element set selected
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
void refreshElementSet()
refresh element set
begin/end of the description of a route
FXCheckButton * myCheckBoxLocked
check box to check if GLObject type is blocked
void enableMatchAttribute()
enable match attributes
FXRealSpinner * mySelectionScaling
Spinner for selection scaling.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
#define GUIDesignComboBox
GNEViewNet * myViewNet
View Net.
~GNESelectorFrame()
Destructor.
FXComboBox * myMatchTagComboBox
tag of the match box
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
changes the visual scaling of selected items
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
FXComboBox * myMatchAttrComboBox
attributes of the match box
void showTypeEntries()
show type Entries (depending if we're in Network or demand supermode)
GNEUndoList * getUndoList() const
get the undoList object
long onCmdSelMBString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
SelectionOperation()
FOX needs this.
long onCmdSelectModificationMode(FXObject *, FXSelector, void *)
stop placed over a charging station (used in netedit)
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
#define GUIDesignHorizontalSeparator
#define GUIDesignTextField
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
void showObjectTypeEntry()
show ObjectTypeEntry
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.
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Supermode currentSupermode
the current supermode
LockGLObjectTypes(GNESelectorFrame *selectorFrameParent)
constructor
void removeLockedObject(const GUIGlObjectType type)
set object unselected
FXDEFMAP(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry) ObjectTypeEntryMap[]
FXTextField * myMatchString
string of the match
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
block movement of a graphic element
stop placed over a containerStop (used in netedit)
stop placed over a busStop (used in netedit)
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
bool ACsToSelected() const
check if there is ACs to select/unselect
bool autoSelectNodes()
whether to autoselect nodes or to lanes
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
ObjectTypeEntry()
FOX needs this.
#define GUIDesignMatrixLockGLTypes
Matrix for pack GLTypes (used in GNESelectorFrame)
ElementSet()
FOX needs this.
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
long onCmdSelectElementSet(FXObject *, FXSelector, void *)
Called when the user change the set of element to search (netElement, Additional or shape) ...
FXRadioButton * myKeepRadioButton
keep button
SumoXMLAttr myCurrentAttribute
current SumoXMLTag Attribute
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
ElementSetType
FOX-declaration.
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
SumoXMLTag myCurrentTag
current SumoXMLTag tag
class for object types entries
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
begin/end of the description of an edge
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
void setSelectionScaling(double selectionScale)
set selection scaling
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
#define GUIDesignTextFieldNCol
Num of column of text field.
reserved GLO type to pack all additionals
long onCmdInvert(FXObject *, FXSelector, void *)
Called when the user presses the Invert-button.
ModificationMode * getModificationModeModul() const
get modification mode modul
LockGLObjectTypes * myLockGLObjectTypes
modul for lock selected items
virtual void show()
show Frame
~VisualScaling()
destructor
#define GUIDesignDialogBox
MatchAttribute * myMatchAttribute
modul for matchA ttribute
long onCmdSelMBAttribute(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
struct with the attribute Properties
static StringBijection< GUIGlObjectType > TypeNames
associates object types with strings
Demanding mode (Routes, Vehicles etc..)
VisualScaling()
FOX needs this.
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
ElementSetType getElementSet() const
get current selected element set
virtual void hide()
hide Frame
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
GNENet * getNet() const
get the net object
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
begin/end of the description of a embedded route (used in NETEDIT)
GUIGlID getGlID() const
Returns the numerical id of the object.
#define GUIDesignButtonOK
std::map< GUIGlObjectType, std::pair< Supermode, ObjectTypeEntry *> > myTypeEntries
check boxes for type-based selection locking and selected object counts
Static storage of an output device and its base (abstract) implementation.
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
#define GUIDesignSpinDial
ModificationMode * myModificationMode
modul for change modification mode
a single trip definition (used by router)
parent of an additional element
FXRadioButton * myRemoveRadioButton
remove radio button
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
void counterDown()
down count
#define GUIDesignLabelLeft
std::vector< GNEAttributeCarrier * > getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string &expr)
return ACs of the given type with matching attrs
select attribute in selector frame
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
#define GUIDesignRadioButton
long onCmdScaleSelection(FXObject *, FXSelector, void *)
Called when the user changes visual scaling.
Network mode (Edges, junctions, etc..)
ElementSet * myElementSet
modul for select element set
MatchAttribute()
FOX needs this.
ModificationMode()
FOX needs this.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
bool isGLTypeLocked() const
check if current GLType is blocked
~LockGLObjectTypes()
destructor
~ModificationMode()
destructor
SetOperation myModificationModeType
how to modify selection
const POIs & getPOIs() const
Returns all pois.