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)
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.
std::vector< Cell * > getCellsInRect(const Rect &rec)
Returns all cells in the rect.
Trigger * createTrigger(const std::string &triggerName, const std::vector< Cell * > &cells)
Creates and adds a trigger to the specified cells.
CellCache * getCellCache()
Returns the CellCache of this layer.
static Logger _log(LM_AUDIO)
virtual ~TriggerController()
Destructor.
void removeTrigger(const std::string &triggerName, Layer *layer, const ModelCoordinate &pt)
Removes a trigger from the cell on the specified layer and coordinate.
Layer * getLayer() const
Gets the layer where this location is pointing to.
ModelCoordinate getLayerCoordinates() const
Gets cell precision layer coordinates set to this 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.
void deleteTrigger(const std::string &triggerName)
Deltes trigger with the given name.
Trigger * createTrigger(const std::string &triggerName)
Creates a trigger.
Trigger get triggered when a specific set of criteria are met.
bool exists(const std::string &name)
Checks to see if the trigger name already exists.
TriggerNameMap m_triggerNameMap
Trigger name map.
An Instance is an "instantiation" of an Object at a Location.
TriggerController(Map *map)
Constructor.