59 std::pair<TriggerNameMapIterator, bool> returnValue;
62 if (!returnValue.second) {
64 FL_WARN(
_log,
LMsg(
"TriggerController::createTrigger() - ") <<
"Trigger " << triggerName <<
" already exists.... ignoring.");
67 return returnValue.first->second;
74 trigger->
assign(layer, pt);
82 for (std::vector<ModelCoordinate>::const_iterator it = coords.begin(); it != coords.end(); ++it) {
83 trigger->
assign(layer, *it);
94 for (std::vector<Cell*>::iterator it = cells.begin(); it != cells.end(); ++it) {
111 for (std::vector<Location>::const_iterator it = locs.begin(); it != locs.end(); ++it) {
112 trigger->
assign((*it).getLayer(), (*it).getLayerCoordinates());
127 for (std::vector<Cell*>::const_iterator it = cells.begin(); it != cells.end(); ++it) {
137 trigger->
attach(instance);
160 it->second->remove(layer, pt);
167 for (std::vector<ModelCoordinate>::const_iterator cit = coords.begin(); cit != coords.end(); ++cit) {
168 it->second->remove(layer, *cit);
177 for (std::vector<Cell*>::iterator cit = cells.begin(); cit != cells.end(); ++cit) {
178 it->second->remove(*cit);
193 for (std::vector<Location>::const_iterator cit = locs.begin(); cit != locs.end(); ++cit) {
194 it->second->remove((*cit).getLayer(), (*cit).getLayerCoordinates());
202 it->second->remove(cell);
209 for (std::vector<Cell*>::const_iterator cit = cells.begin(); cit != cells.end(); ++cit) {
210 it->second->remove(*cit);
218 if (it->second->getAttached() == instance) {
219 it->second->detach();
225 std::vector<Trigger*> triggers;
228 triggers.push_back(it->second);
234 std::vector<std::string> names;
237 names.push_back(it->first);
#define FL_WARN(logger, msg)
Layer * getLayer() const
Gets the layer where this location is pointing to.
Helper class to create log strings out from separate parts Usage: LMsg("some text") << variable << "...
void attach(Instance *instance)
Attaches the trigger to the given instance.
Trigger * createTriggerOnRect(const std::string &triggerName, Layer *layer, const Rect &rec)
Creates and adds a trigger to the cells on the specified layer and rect.
void removeTriggerFromCoordinate(const std::string &triggerName, Layer *layer, const ModelCoordinate &pt)
Removes a trigger from the cell on the specified layer and coordinate.
std::vector< Cell * > getCellsInRect(const Rect &rec)
Returns all cells in the rect.
Trigger * createTriggerOnInstance(const std::string &triggerName, Instance *instance)
Creates and attach a trigger to the specified instance.
CellCache * getCellCache()
Returns the CellCache of this layer.
Trigger * createTriggerOnCoordinate(const std::string &triggerName, Layer *layer, const ModelCoordinate &pt)
Creates and adds a trigger to the cell on the specified layer and coordinate.
Trigger * createTriggerOnCoordinates(const std::string &triggerName, Layer *layer, const std::vector< ModelCoordinate > &coords)
Creates and adds a trigger to the cells on the specified layer and coordinates.
static Logger _log(LM_AUDIO)
virtual ~TriggerController()
Destructor.
void removeTriggerFromCell(const std::string &triggerName, Cell *cell)
Removes a trigger from the specified cell.
Trigger * createTriggerOnLocation(const std::string &triggerName, const Location &loc)
Creates and adds a trigger to the cell on the specified location.
std::vector< Trigger * > getAllTriggers()
Returns a vector with all trigger pointers.
std::pair< std::string, Trigger *> TriggerNameMapPair
std::vector< std::string > getAllTriggerNames()
Returns a vector with all trigger names.
Trigger * getTrigger(const std::string &triggerName)
Returns a pointer to the trigger with the given name.
void assign(Layer *layer, const ModelCoordinate &pt)
Assigns trigger on given layer and position.
std::map< std::string, Trigger *>::iterator TriggerNameMapIterator
A basic cell on a CellCache.
Trigger * createTriggerOnCell(const std::string &triggerName, Cell *cell)
Creates and adds a trigger to the specified cell.
void removeTriggerFromInstance(const std::string &triggerName, Instance *instance)
Detach a trigger from the specified instance.
void deleteTrigger(const std::string &triggerName)
Deletes a trigger with the given name.
void removeTriggerFromRect(const std::string &triggerName, Layer *layer, const Rect &rec)
Removes a trigger from the cell on the specified layer and coordinates.
void removeTriggerFromLocations(const std::string &triggerName, const std::vector< Location > &locs)
Removes a trigger from the cell on the specified locations.
Trigger * createTrigger(const std::string &triggerName)
Creates a trigger.
Trigger get triggered when a specific set of criteria are met.
ModelCoordinate getLayerCoordinates() const
Gets cell precision layer coordinates set to this location.
Trigger * createTriggerOnLocations(const std::string &triggerName, const std::vector< Location > &locs)
Creates and adds a trigger to the cell on the specified locations.
bool exists(const std::string &name)
Checks to see if the trigger name already exists.
Trigger * createTriggerOnCells(const std::string &triggerName, const std::vector< Cell *> &cells)
Creates and adds a trigger to the specified cells.
TriggerNameMap m_triggerNameMap
Trigger name map.
void removeTriggerFromCells(const std::string &triggerName, const std::vector< Cell *> &cells)
Removes a trigger from the specified cells.
void removeTriggerFromCoordinates(const std::string &triggerName, Layer *layer, const std::vector< ModelCoordinate > &coords)
Removes a trigger from the cell on the specified layer and coordinates.
void removeTriggerFromLocation(const std::string &triggerName, const Location &loc)
Removes a trigger from the cell on the specified location.
An Instance is an "instantiation" of an Object at a Location.
TriggerController(Map *map)
Constructor.