19 #ifndef UTILS_SHAPES_POLYGONDYNAMICS_H_ 20 #define UTILS_SHAPES_POLYGONDYNAMICS_H_ 49 const std::vector<double>& timeSpan,
50 const std::vector<double>& alphaSpan,
const std::string & getTrackedObjectID() const
std::unique_ptr< Position > myTrackedObjectsInitialPositon
Initial position of the tracked object.
virtual ~PolygonDynamics()
std::vector< double >::const_iterator myPrevTime
Pointer to the next time points in timeSpan.
bool rotate
Whether this polygon should be rotated with the tracked object.
const std::string & getPolygonID() const
Storage for geometrical objects.
void initTrackedPosition()
Initialize the object's position.
const std::string & getID() const
Returns the id.
double myCurrentTime
Current time.
A RT-tree for efficient storing of SUMO's GL-objects.
void setRTree(SUMORTree *rtree)
Set the RTree.
bool tracking
Whether this polygon tracks an object.
bool looped
Whether animation should be looped.
std::unique_ptr< std::vector< double > > myTimeSpan
Time points corresponding to the anchor values of the dynamic properties.
SUMORTree * myVis
RTree will be supplied in case of GUI simulation to be updated on move.
std::vector< double >::const_iterator myNextTime
bool animated
Whether this polygon is animated, i.e., whether timelines should be used to control properties...
std::vector< double >::const_iterator myNextAlpha
double myLastUpdateTime
The last time the animation has been updated.
SUMOTime update(SUMOTime t)
Updates the polygon according to its timeSpan and follows the tracked object.
SUMOPolygon * getPolygon() const
double myTrackedObjectsInitialAngle
Initial angle of the tracked object.
Representation of a vehicle or person.
SUMOTrafficObject * myTrackedObject
An object tracked by the shape, deletion by caller.
std::string myTrackedObjectID
void setAlpha(double alpha)
Sets the alpha value for the shape's color.
std::unique_ptr< PositionVector > myOriginalShape
the original shape of the polygon (in case of tracking another object, this is converted to relative ...
std::vector< double >::const_iterator myPrevAlpha
Pointer to the next alpha points in alphaSpan.
SUMOPolygon * myPolygon
The polygon this dynamics acts upon.
std::unique_ptr< std::vector< double > > myAlphaSpan
Alpha values corresponding to.
PolygonDynamics(double creationTime, SUMOPolygon *p, SUMOTrafficObject *trackedObject, const std::vector< double > &timeSpan, const std::vector< double > &alphaSpan, bool looped, bool rotate)
Constructor that takes a SUMOPolygon and adds timelines for the properties to be modified dynamically...