44 undoList->begin(distribution,
TLF(
"add '%' key in % '%'", key->getID(), distribution->getTagStr(), distribution->getID()));
45 undoList->add(change,
true);
55 undoList->
begin(distribution,
TLF(
"remove '%' key from % '%'", key->getID(), distribution->
getTagStr(), distribution->
getID()));
56 undoList->
add(change,
true);
66 undoList->
begin(distribution,
TLF(
"change '%' key value from % to %", key->getID(), newValue, newValue));
67 undoList->
add(change,
true);
136 myDistribution(distribution),
138 myOriginalProbability(-1),
139 myNewProbability(value),
141 myEditingProbability(false) {
148 myDistribution(distribution),
150 myOriginalProbability(originalValue),
151 myNewProbability(newValue),
153 myEditingProbability(true) {
Supermode
@brie enum for supermodes
@ DEMAND
Demand mode (Routes, Vehicles etc..)
bool isUndoRedoAllowed() const
const std::string getID() const
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * getNet() const
get pointer to net
the function-object for an editing operation (abstract base)
static void editValue(GNEDemandElement *distribution, const GNEDemandElement *key, const double newValue, GNEUndoList *undoList)
edit value
GNEDemandElement * myDistribution
the distribution to which all operations shall be applied
GNEChange_Distribution(GNEDemandElement *distribution, const GNEDemandElement *key, const double value, const bool addKey)
constructor for add/modify key
const double myNewProbability
the new value
const GNEDemandElement * myKey
the key
const bool myAddKey
flag for check if we're adding or removing key
const bool myEditingProbability
flag for check if we're editing value
const double myOriginalProbability
the original value
static void removeKey(GNEDemandElement *distribution, const GNEDemandElement *key, GNEUndoList *undoList)
remove key
~GNEChange_Distribution()
Destructor.
std::string undoName() const
return undoName
std::string redoName() const
get Redo name
the function-object for an editing operation (abstract base)
double getAttributeDistributionValue(const GNEDemandElement *key)
get attribute distribution value
void removeDistributionKey(const GNEDemandElement *key, GNEUndoList *undoList)
remove distribution key
void addDistributionKey(const GNEDemandElement *key, const double value, GNEUndoList *undoList)
add distribution key
void editDistributionValue(const GNEDemandElement *key, const double newValue, GNEUndoList *undoList)
remove distribution (used in GNEDemandElementDistribution)
void requireSaveDemandElements()
inform that demand elements has to be saved
GNENetHelper::SavingStatus * getSavingStatus() const
get saving status
GNEViewNet * getViewNet() const
get view net
void decRef(const std::string &debugMsg="")
Decrease reference.
void incRef(const std::string &debugMsg="")
Increase reference.
bool unreferenced()
check if object ins't referenced
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEViewParent * getViewParent() const
get the net object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows