Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETemplateElementList< elementDialogType, elementType, GNEChange_Type > Class Template Referenceabstract

#include <GNETemplateElementList.h>

Inheritance diagram for GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >:
[legend]
Collaboration diagram for GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >:
[legend]

Public Types

enum class  Options : int {
  NONE = 1 << 0 , SORTELEMENTS = 1 << 1 , DIALOG_ELEMENT = 1 << 2 , DIALOG_VCLASS = 1 << 3 ,
  FIXED_HEIGHT = 1 << 4
}
 FOX-declaration. More...
 

Public Member Functions

virtual long addNewElement ()=0
 add new element (must be implemented in children)
 
bool checkSort () const
 check if the elements are sorted
 
void disableList (const std::string &reason)
 disable list
 
void enableList ()
 enable list
 
const std::vector< elementType * > & getEditedElements () const
 get edited elements
 
 GNETemplateElementList (GNETemplateElementDialog< elementDialogType > *elementDialogParent, FXVerticalFrame *contentFrame, SumoXMLTag tag, GNEElementList::Options options)
 constructor
 
long insertElement (elementType *element)
 insert element
 
bool isListValid () const
 check if the current list is valid
 
virtual long openElementDialog (const size_t rowIndex)=0
 open element dialog (optional
 
long removeElement (const elementType *element)
 remove element
 
long removeElement (const size_t rowIndex)
 remove element (using index)
 
long sortRows ()
 open dialog
 
long updateList ()
 update element list
 
FOX callbacks
long onCmdAddRow (FXObject *sender, FXSelector, void *)
 called when user press add button
 
long onCmdSort (FXObject *sender, FXSelector, void *)
 called when user press sort button
 

Protected Member Functions

void removeElementRecursively (GNEAdditional *additionalElement) const
 delete additional element recursively
 
void removeElementRecursively (GNEDemandElement *demandElement) const
 delete demand element recursively
 

Protected Attributes

std::vector< elementType * > myEditedElements
 edited elements
 
GNETemplateElementDialog< elementDialogType > * myElementDialogParent = nullptr
 element dialog parent
 
GNEElementTablemyElementTable = nullptr
 element table
 
const GNETagPropertiesmyTagProperty = nullptr
 FOX needs this.
 

Private Types

typedef std::tuple< double, double, double, double, double, double, elementType * > SortTuple
 typedef used for sorting elements by attributes
 

Private Member Functions

std::vector< SortTuplegetSortTuples (const bool sort) const
 get element sorted
 
 GNETemplateElementList (const GNETemplateElementList &)=delete
 Invalidated copy constructor.
 
GNETemplateElementListoperator= (const GNETemplateElementList &)=delete
 Invalidated assignment operator.
 

Private Attributes

FXButton * myAddButton = nullptr
 add button
 
FXLabel * myLabel = nullptr
 label
 
FXButton * mySortButton = nullptr
 sort button
 

Detailed Description

template<typename elementDialogType, typename elementType, typename GNEChange_Type>
class GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >

Definition at line 33 of file GNETemplateElementList.h.

Member Typedef Documentation

◆ SortTuple

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
typedef std::tuple<double, double, double, double, double, double, elementType*> GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::SortTuple
private

typedef used for sorting elements by attributes

Definition at line 137 of file GNETemplateElementList.h.

Member Enumeration Documentation

◆ Options

enum class GNEElementList::Options : int
stronginherited

FOX-declaration.

enum class for element list options

Enumerator
NONE 
SORTELEMENTS 
DIALOG_ELEMENT 
DIALOG_VCLASS 
FIXED_HEIGHT 

Definition at line 41 of file GNEElementList.h.

Constructor & Destructor Documentation

◆ GNETemplateElementList() [1/2]

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::GNETemplateElementList ( GNETemplateElementDialog< elementDialogType > *  elementDialogParent,
FXVerticalFrame *  contentFrame,
SumoXMLTag  tag,
GNEElementList::Options  options 
)
inline

◆ GNETemplateElementList() [2/2]

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::GNETemplateElementList ( const GNETemplateElementList< elementDialogType, elementType, GNEChange_Type > &  )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ addNewElement()

◆ checkSort()

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
bool GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::checkSort ( ) const
inline

check if the elements are sorted

Definition at line 77 of file GNETemplateElementList.h.

References GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::getSortTuples().

◆ disableList()

◆ enableList()

◆ getEditedElements()

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
const std::vector< elementType * > & GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::getEditedElements ( ) const
inline

get edited elements

Definition at line 46 of file GNETemplateElementList.h.

References GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::myEditedElements.

Referenced by GNERerouterIntervalDialog::onCmdAccept().

Here is the caller graph for this function:

◆ getSortTuples()

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
std::vector< SortTuple > GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::getSortTuples ( const bool  sort) const
inlineprivate

◆ insertElement()

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
long GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::insertElement ( elementType *  element)
inline

◆ isListValid()

bool GNEElementList::isListValid ( ) const
inherited

check if the current list is valid

Definition at line 94 of file GNEElementList.cpp.

References GNEElementTable::isValid(), and GNEElementList::myElementTable.

Referenced by GNECalibratorDialog::onCmdAccept(), and GNERerouterIntervalDialog::onCmdAccept().

Here is the caller graph for this function:

◆ onCmdAddRow()

long GNEElementList::onCmdAddRow ( FXObject *  sender,
FXSelector  ,
void *   
)
inherited

called when user press add button

Definition at line 100 of file GNEElementList.cpp.

References GNEElementList::addNewElement().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSort()

long GNEElementList::onCmdSort ( FXObject *  sender,
FXSelector  ,
void *   
)
inherited

called when user press sort button

Definition at line 106 of file GNEElementList.cpp.

References GNEElementList::sortRows().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ openElementDialog()

◆ operator=()

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
GNETemplateElementList & GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::operator= ( const GNETemplateElementList< elementDialogType, elementType, GNEChange_Type > &  )
privatedelete

Invalidated assignment operator.

◆ removeElement() [1/2]

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
long GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::removeElement ( const elementType *  element)
inline

◆ removeElement() [2/2]

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
long GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::removeElement ( const size_t  rowIndex)
inlinevirtual

remove element (using index)

Implements GNEElementList.

Definition at line 103 of file GNETemplateElementList.h.

References GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::myEditedElements, GNEElementList::removeElementRecursively(), and GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::updateList().

Referenced by GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::removeElement().

Here is the caller graph for this function:

◆ removeElementRecursively() [1/2]

void GNEElementList::removeElementRecursively ( GNEAdditional additionalElement) const
protectedinherited

◆ removeElementRecursively() [2/2]

void GNEElementList::removeElementRecursively ( GNEDemandElement demandElement) const
protectedinherited

◆ sortRows()

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
long GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::sortRows ( )
inlinevirtual

◆ updateList()

Field Documentation

◆ myAddButton

FXButton* GNEElementList::myAddButton = nullptr
privateinherited

add button

Definition at line 108 of file GNEElementList.h.

Referenced by GNEElementList::disableList(), and GNEElementList::enableList().

◆ myEditedElements

◆ myElementDialogParent

template<typename elementDialogType , typename elementType , typename GNEChange_Type >
GNETemplateElementDialog<elementDialogType>* GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::myElementDialogParent = nullptr
protected

◆ myElementTable

◆ myLabel

FXLabel* GNEElementList::myLabel = nullptr
privateinherited

label

Definition at line 114 of file GNEElementList.h.

Referenced by GNEElementList::disableList(), and GNEElementList::enableList().

◆ mySortButton

FXButton* GNEElementList::mySortButton = nullptr
privateinherited

sort button

Definition at line 111 of file GNEElementList.h.

Referenced by GNEElementList::disableList(), and GNEElementList::enableList().

◆ myTagProperty

const GNETagProperties* GNEElementList::myTagProperty = nullptr
protectedinherited

FOX needs this.

pointer to tag property

Definition at line 95 of file GNEElementList.h.

Referenced by GNEElementList::enableList(), and GNETemplateElementList< elementDialogType, elementType, GNEChange_Type >::updateList().


The documentation for this class was generated from the following file: