43 virtual void configure(TiXmlElement *eClock)
override;
44 virtual void save(TiXmlElement *eParent)
const override;
65 void tick(
bool blocking =
true);
228 void rebuild(
Real oldTimeStep );
229 void schedule(
Event *event);
230 void schedule(
Event *event,
Real timeUntilDispatch);
231 void unschedule(
Event *event);
232 void reschedule(
Event *event);
235 void calculateTimestep();
265 bool m_isTimelineResponsible =
true;
351 Real calculateTimeUntilDispatch(
Real timeStep );
352 Real calculateTimeUntilDispatch();
356 void setIndex(
size_t index);
369 UInt m_scheduledFrame;
423 AGX_FORCE_INLINE bool Clock::Event::isRepeating()
const {
return m_interval->get() >= 0; }
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_DECLARE_VECTOR_TYPES(type)
Templated value-reference.
Abstract representation of a value.
Generalized callback, using std::function.
FrameWrapper(Clock *clock)
void addFrameTask(Task *child)
Clock class keeps representation of virtual/simulated time.
void removeEvent(agx::Clock::Event *event)
Remove an event from the clock.
agx::Real getFrequency() const
agx::Real getInterval() const
Get the trigger interval.
void setInterval(agx::Real interval)
Set the trigger interval.
void stepTo(agx::Real time)
Advance the clock to a specified time.
Event(const agx::Callback &callback, agx::Real startDelay, agx::Real interval=-1.0)
virtual void configure(TiXmlElement *eClock) override
void setEnable(bool flag)
Pause/unpause.
agx::Clock * getReference()
void reset()
Reset to frame zero (and time=0), remove all events.
virtual void rebind() override
Event(const agx::Name &name="Event")
Constructor.
static Clock * load(TiXmlElement *eClock, Device *device)
void addSlave(agx::Clock *slave)
Add a slave clock, to be driven by this clock.
const agx::ClockPtrVector & getSlaves() const
void setFrequency(agx::Real frequency)
Set the clock frequency.
agx::Real getTimeStep() const
void removeFrameJob(agx::Job *job)
Remove a frame job.
virtual void configure(TiXmlElement *eEvent) override
void removeSlave(agx::Clock *slave)
Remove a slave clock.
void start()
Same as setEnable(true)
void removeFrameTask(agx::Task *task)
Remove a frame task.
void addFrameTask(agx::Task *task)
Add a task to be executed on each tick.
void setTime(agx::Real64 time)
Set the time explicitly, without ticking.
static agx::Model * ClassModel()
agx::Real getStartDelay() const
bool getIsThreadTimelineResponsible() const
agx::Real getTime() const
void setTimeModulation(agx::Real modulation)
Set the time modulation of the clock, default is 1.0.
void stop()
Same as setEnable(false)
void tick(bool blocking=true)
Advance the clock to the next time step.
virtual void save(TiXmlElement *eParent) const override
void setStartDelay(agx::Real time)
Set the start delay when added to a clock or reset.
static Clock::Event * load(TiXmlElement *eEvent, Device *device)
void setIsThreadTimelineResponsible(bool isResponsible)
Control whether this Clock is the main clock for thread timeline generation.
Event1< Clock * > TickEvent
bool setTimeStep(agx::Real dt)
Set the time step of the clock, 1/frequency.
void setEnable(agx::Bool flag)
Set to false to disable the clock, tick will be void operation.
void setRepeating(bool flag)
Set if event trigger multiple times.
const agx::Path & getBindPath() const
Clock(const agx::Name &name="clock", agx::Real frequency=60)
void setFrame(UInt frame)
Explicitly set the current frame index.
void addEvent(agx::Clock::Event *event)
Add an event to the clock to be triggered as specified by the event.
agx::Real getTimeModulation() const
void bind(const agx::Path &path)
Bind the clock to a reference clock using a bindpath.
agx::Bool isEnabled() const
void stepForward(agx::Real delta)
Advance the clock a specified interval.
agx::UInt getFrame() const
void addFrameJob(agx::Job *job)
Add a job to be executed on each tick.
A component is an object containing other objects, enabling hierarchical structuring.
An agx::Device is an abstract representation of a device on which data can be stored and processed.
An event with one argument.
An event with no arguments.
An abstract job/workblock representation, which allows work threads to execute arbitrary tasks.
Inheritance with partial specialization due to bug with ref_ptr containers.
A model is an abstract representation of the class of an agx::Object.
Representation of a name string.
Representation of a path, a list of name components.
A representation of a generic task.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.