AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
StatisticsEntries.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. 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#pragma once
18
19#include <agx/Statistics.h>
20#include <agxRender/Graph.h>
21
22namespace agxSDK
23{
25 {
26 public:
28 void init();
29
30 void registerEntry(const agx::String& title,
31 const agx::String& module,
32 const agx::String& data,
33 const agx::Vec4& color,
34 bool optional = false,
35 float textSize=1);
36
37 void registerGraphEntry(const agx::String& module,
38 const agx::String& data,
39 const agx::String& title,
40 const agx::Vec4& color,
41 float minVal,
42 float maxVal,
43 float scaleX,
44 float scaleY);
45
46 void unregisterEntry(const agx::String& module, const agx::String& data);
47 void unregisterGraphEntry(const agx::String& module, const agx::String& data);
48
49 void render(Simulation* simulation);
51
52 void reset();
53
54 bool firstRun();
55
56 protected:
57
58 private:
59 struct Entry {
60 Entry() : optional(false), m_value(0) {}
61 Entry(const agx::String& t, const agx::String& m, const agx::String& d, const agx::Vec4& c, bool o = false, float _textSize=1) :
62 color(c), module(m), data(d), title(t), optional(o), m_value(0), textSize(_textSize) {}
63
64 agx::Vec4 color;
65 agx::String module;
66 agx::String data;
67 agx::String title;
68 bool optional;
69
71 float textSize;
72
73 bool operator==(const Entry& other) const {
74 return (module == other.module && data == other.data );
75 }
76 };
77 agx::Vector<Entry> m_entries;
78
79 struct GraphEntry {
80 GraphEntry() : m_value(0) {}
81 GraphEntry(const agx::String& m, const agx::String& d, agxRender::Graph::Channel* c) : module(m), data(d), channel(c) {}
82 agx::String module;
83 agx::String data;
84
85
88
89 bool operator==(const GraphEntry& other) const {
90 return (module == other.module && data == other.data );
91 }
92 };
93 agx::Vector<GraphEntry> m_graphEntries;
94
95 bool m_firstRun;
96 agx::TimeStamp m_prevStamp;
97 float m_textSize;
98 };
99}
Internal class for handling data for a channel.
Definition: Graph.h:119
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:131
void unregisterGraphEntry(const agx::String &module, const agx::String &data)
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 registerEntry(const agx::String &title, const agx::String &module, const agx::String &data, const agx::Vec4 &color, bool optional=false, float textSize=1)
void unregisterEntry(const agx::String &module, const agx::String &data)
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
Templated vector class.
Definition: agx/Vector.h:53
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
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:213
agx::Real TimeStamp
Definition: TimeStamp.h:26