Spaces and Zones
fort::myrmidon::Space
-
class Space
An homogenous coordinate system for tracking data.
A Space represent the physical space tracked by one single Camera. Coordinates in one Space cannot be compared with coordinate from another Space.
Space are uniquely identified with their ID().
Zoning
Within a single Space, it could be relevant to define Zone where interaction between Ant could be measured. I.e. Ant in different Zone won’t report interactions.
Zone are manipulated with CreateZone() and DeleteZone().
Note
Space can only be created from an Experiment with Experiment::CreateSpace()
Public Functions
-
Zone::Ptr CreateZone(const std::string &name)
Creates a new Zone in this Space.
- Parameters:
name – the Zone::Name()
- Returns:
the newly created Zone
-
const ZoneByID &Zones() const
Gets the Zones in this space.
-
Zone::Ptr CreateZone(const std::string &name)
fort::myrmidon::Zone
-
class Zone
A tracking region where collisions/interactions are computed.
A Zone defines a tracked area region where collisions and interactions can be computed. I.e. two Ant in different Zone won’t report any collisions or interactions.
Naming and Identification
Zone are managed by Space, and have a unique ZoneID within an experiment. Zone have a user definable Name() but internally only their ZoneID is used.
By default, any Ant is considered to be within the
null
Zone with ZoneID 0, so all possible interactions are reported. User needs to add Zone only to prune unwanted interactions or to be able to query where an Ant is at any given Time.Geometric definition
Zone have time valid ZoneDefinition. In most cases there would be a single ZoneDefinition for any Zone valid for ]Time::SinceEver(),Time::Forever()[, but it is possible to assign different ZoneDefinition::Shapes() for different time range using multiple ZoneDefinition.
ZoneDefinition are manipulated using AddDefinition() and DeleteDefinition().
Note
Zone can only be created from a Space with Space::CreateZone().
Public Functions
-
ZoneDefinition::Ptr AddDefinition(const Shape::List &shapes, const Time &start, const Time &end)
Adds a new timed ZoneDefinition.
Adds a new timed ZoneDefinition valid for [start,end[ to this Zone. It accepts Time::SinceEver() and Time::Forever() for start or end.
- Parameters:
shapes – the shape of the Zone as a Shape::List
start – the first valid Time for this definition.
end – the first invalid Time for this definition.
- Throws:
std::invalid_argument – if start or end would make the resulting definition overlap in time with another ZoneDefinition for this Zone.
- Returns:
the new ZoneDefinition
-
const ZoneDefinitionList &Definitions() const
Gets the Zone’s ZoneDefinition.
- Returns:
a ZoneDefinition::List of ZoneDefinition for this Zone
-
void DeleteDefinition(size_t index)
Removes a ZoneDefinition.
- Parameters:
index – the index in Definitions() to remove.
- Throws:
std::out_of_range – if index >= Definitions().size()
-
ZoneDefinition::Ptr AddDefinition(const Shape::List &shapes, const Time &start, const Time &end)
fort::myrmidon::ZoneDefinition
-
class ZoneDefinition
Defines the geometry of a Zone in Time.
ZoneDefinition contains for a time range [Start(),End()[ the Shapes() for a Zone.
Note
ZoneDefinition can only be created from a Zone with Zone::AddDefinition().
Public Types
-
typedef std::shared_ptr<ZoneDefinition> Ptr
A pointer to a Zone.
Public Functions
-
const Shape::List &Shapes() const
Gets the geometry of this ZoneDefinition.
-
void SetShapes(const Shape::List &shapes)
Sets the Shapes of this ZoneDefinition.
-
const Time &Start() const
Gets the first valid time of the ZoneDefinition.
- Returns:
the first valid Time of this definition. It can be Time::SinceEver().
-
const Time &End() const
Gets the first invalid time of the ZoneDefinition.
- Returns:
the first invalid Time of this definition. It can be Time::Forever().
-
void SetStart(const Time &start)
Sets the first valid time of the ZoneDefinition.
- Parameters:
start – the first valid Time of this definition. It can be Time::SinceEver().
-
void SetEnd(const Time &end)
Sets the first invalid time of the ZoneDefinition.
- Parameters:
end – the first invalid Time of this definition. It can be Time::Forever().
-
typedef std::shared_ptr<ZoneDefinition> Ptr