AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
StatisticsTrack.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGX_STATISTICSTRACK_H
18#define AGX_STATISTICSTRACK_H
19
20#include <agx/Statistics.h>
21#include <agx/Clock.h>
22#include <agxData/FrameIO.h>
23
24namespace agxSDK
25{
27}
28
29namespace agx
30{
32 {
33 public:
35
36
37 virtual agxData::Frame *readFrame() override;
38
39 protected:
41
42 private:
43 class DataBinding : public agxData::Frame::DataBinding
44 {
45 public:
46 DataBinding(const agx::Path& internalPath, const agx::Path& externalPath, Statistics::AbstractData *data = nullptr);
47
48 Statistics::AbstractData *getData();
49 void setData(Statistics::AbstractData *data);
50
51 protected:
52 virtual ~DataBinding();
53
54 private:
56 };
57
58 virtual agxData::Frame::DataBinding *createDataBinding(const agx::Path& internalPath, const agx::Path& externalPath) override;
59 void updateCallback(Clock *clock);
60
61 private:
62 agxSDK::SimulationRef m_simulation;
63 ClockRef m_clock;
64 Statistics *m_statistics;
65 TaskRef m_updateTask;
66 mutable agx::Block m_clockBlock;
67 mutable agx::Block m_readerBlock;
68 Clock::TickEvent::CallbackType m_updateCallback;
69 };
70
71}
72
73
74#endif /* AGX_STATISTICSTRACK_H */
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
The FrameReader reads frames from an external source.
Definition FrameIO.h:127
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition Simulation.h:126
Block synchronization primitive.
Clock class keeps representation of virtual/simulated time.
Definition Clock.h:38
T CallbackType
Definition Event.h:37
Representation of a path, a list of name components.
Definition Path.h:33
virtual agxData::Frame * readFrame() override
Reads the next frame from the stream and moves the stream forward one frame.
StatisticsFrameReader(agxSDK::Simulation *simulation, Clock *clock, Statistics *statistics=Statistics::instance())
Base statistics gathering class.
Definition Statistics.h:99
static Statistics * instance()
AbstractData(const char *name, const agxData::Format *format)
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition Constraint.h:31
The agx namespace contains the dynamics/math part of the AGX Dynamics API.