AGX Dynamics  2.35.0.1
StatisticsEntries.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXSDK_STATISTICS_ENTRIES
18 #define AGXSDK_STATISTICS_ENTRIES
19 
20 #include <agx/Statistics.h>
21 #include <agxRender/Graph.h>
22 
23 namespace agxSDK
24 {
26  {
27  public:
29  void init();
30 
31  void registerEntry(const agx::String& title, const agx::String& module, const agx::String& data, const agx::Vec4& color, bool optional = false);
32  void registerGraphEntry(const agx::String& module, const agx::String& data, const agx::String& title, const agx::Vec4& color,
33  float minVal, float maxVal, float scaleX, float scaleY);
34 
35  void unregisterEntry(const agx::String& module, const agx::String& data);
36  void unregisterGraphEntry(const agx::String& module, const agx::String& data);
37 
38  void render(Simulation* simulation);
40 
41  void reset();
42 
43  bool firstRun();
44 
45  protected:
46 
47  private:
48  struct Entry {
49  Entry() : optional(false), m_value(0) {}
50  Entry(const agx::String& t, const agx::String& m, const agx::String& d, const agx::Vec4& c, bool o = false) : color(c), module(m), data(d), title(t), optional(o), m_value(0) {}
51 
52  agx::Vec4 color;
53  agx::String module;
54  agx::String data;
55  agx::String title;
56  bool optional;
57 
59 
60  bool operator==(const Entry& other) {
61  return (module == other.module && data == other.data );
62  }
63  };
64  agx::Vector<Entry> m_entries;
65 
66  struct GraphEntry {
67  GraphEntry() : m_value(0) {}
68  GraphEntry(const agx::String& m, const agx::String& d, agxRender::Graph::Channel* c) : module(m), data(d), channel(c) {}
69  agx::String module;
70  agx::String data;
71 
72 
75 
76  bool operator==(const GraphEntry& other) {
77  return (module == other.module && data == other.data );
78  }
79  };
80  agx::Vector<GraphEntry> m_graphEntries;
81 
82  bool m_firstRun;
83  agx::TimeStamp m_prevStamp;
84  };
85 
86 
87 }
88 #endif
Internal class for handling data for a channel.
Definition: Graph.h:120
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
void unregisterGraphEntry(const agx::String &module, const agx::String &data)
void registerEntry(const agx::String &title, const agx::String &module, const agx::String &data, const agx::Vec4 &color, bool optional=false)
void registerGraphEntry(const agx::String &module, const agx::String &data, const agx::String &title, const agx::Vec4 &color, float minVal, float maxVal, float scaleX, float scaleY)
void render(Simulation *simulation)
void unregisterEntry(const agx::String &module, const agx::String &data)
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:190
agx::Real TimeStamp
Definition: TimeStamp.h:26