32template <
typename elementDialogType,
typename elementType,
typename GNEChange_Type>
39 GNEElementList(contentFrame, elementDialogParent->getApplicationWindow()->getTagPropertiesDatabase()->getTagProperty(tag, true), options),
53 element->getNet()->getViewNet()->getUndoList()->add(
new GNEChange_Type(element,
true),
true);
62 for (
const auto& child :
myElementDialogParent->getElement()->getChildren().template get<elementType*>()) {
63 if (child->getTagProperty()->getTag() ==
myTagProperty->getTag()) {
81 for (
int i = 0; i < ((int)tuples.size() - 1); i++) {
82 if (tuples.at(i) > tuples.at(i)) {
95 for (
const auto& element : sortedTuples) {
119 throw ProcessError(
"Element not found in removeElement");
137 typedef std::tuple<double, double, double, double, double, double, elementType*>
SortTuple;
142 std::vector<SortTuple> elementSortKeyVector;
146 auto tuple = std::make_tuple(0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
myEditedElements.at(i));
148 const auto& sortableAttributes =
myElementTable->getColumnHeader()->getSortableAttributes();
150 if (sortableAttributes.size() > 0) {
153 if (sortableAttributes.size() > 1) {
156 if (sortableAttributes.size() > 2) {
159 if (sortableAttributes.size() > 3) {
162 if (sortableAttributes.size() > 4) {
165 if (sortableAttributes.size() > 5) {
168 elementSortKeyVector.push_back(tuple);
172 std::set<SortTuple> elementSortKeySet;
173 for (
const auto& element : elementSortKeyVector) {
175 elementSortKeySet.insert(element);
178 elementSortKeyVector.clear();
179 for (
const auto& element : elementSortKeySet) {
180 elementSortKeyVector.push_back(element);
183 return elementSortKeyVector;
SumoXMLTag
Numbers representing SUMO-XML - element names.
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
const GNETagProperties * myTagProperty
FOX needs this.
GNEElementList(FXVerticalFrame *contentFrame, const GNETagProperties *tagProperty, GNEElementList::Options options)
constructor
GNEElementTable * myElementTable
element table
void removeElementRecursively(GNEAdditional *additionalElement) const
delete additional element recursively
GNETemplateElementList & operator=(const GNETemplateElementList &)=delete
Invalidated assignment operator.
std::tuple< double, double, double, double, double, double, elementType * > SortTuple
typedef used for sorting elements by attributes
std::vector< SortTuple > getSortTuples(const bool sort) const
get element sorted
const std::vector< elementType * > & getEditedElements() const
get edited elements
long removeElement(const size_t rowIndex)
remove element (using index)
std::vector< elementType * > myEditedElements
edited elements
bool checkSort() const
check if the elements are sorted
long updateList()
update element list
long removeElement(const elementType *element)
remove element
long insertElement(elementType *element)
insert element
long sortRows()
open dialog
GNETemplateElementDialog< elementDialogType > * myElementDialogParent
element dialog parent
virtual long openElementDialog(const size_t rowIndex)=0
open element dialog (optional
GNETemplateElementList(GNETemplateElementDialog< elementDialogType > *elementDialogParent, FXVerticalFrame *contentFrame, SumoXMLTag tag, GNEElementList::Options options)
constructor
virtual long addNewElement()=0
add new element (must be implemented in children)
GNETemplateElementList(const GNETemplateElementList &)=delete
Invalidated copy constructor.