AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
Window.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#pragma once
18
19#include <agxPlot/Curve.h>
20#include <agxPlot/DataPacket.h>
21
22#include <agx/String.h>
23
24namespace agxPlot
25{
26 class System;
27
29 {
30 public:
36 Window(const agx::String& id = "");
37
44 bool add(Curve* curve);
45
47
53 void getNewValues(DataPacket* target);
54
60 void getOldValues(DataPacket* target);
61
63
71 void getDescription(agxJson::Value& root) const;
72
76 void setFromDescription(const agxJson::Value& root);
77
78 const agx::String& getId() const;
79
83 const agx::String& getName() const;
87 void setName(const agx::String& name);
88
89 void setEnabled(bool enabled);
90
91 bool getEnabled() const;
92
94 const CurveRefVector& getCurves() const;
95
97 public:
98 /***************************************/
99 /* HELPER FUNCTIONS FOR CREATING PLOTS */
100 /***************************************/
101 private:
102 friend class System;
103 void setPlotSystem(System *system);
104
105 private:
106 CurveRefVector m_curves;
107 System *m_system;
108 agx::String m_id;
109 agx::String m_name;
110 bool m_isEnabled;
111
112 agx::Event::CallbackType m_curveRepresentationChangedCallback;
113 };
114
117}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition agx/Vector.h:34
Definition of a plot curve.
Definition Curve.h:37
Package of points for a specified curve.
Definition DataPacket.h:56
System that manages the plotting system.
Definition System.h:39
Window(const agx::String &id="")
void setEnabled(bool enabled)
void getNewValues(DataPacket *target)
Get all values that have been added since the last data push.
const CurveRefVector & getCurves() const
Gets the curves belonging to the window.
agx::Event representationChanged
Definition Window.h:96
bool getEnabled() const
void getDescription(agxJson::Value &root) const
Retrieve the description, as follows.
System * getPlotSystem()
void setName(const agx::String &name)
Set the name of the Window.
void getOldValues(DataPacket *target)
Get all values that have been added since the last data push.
const agx::String & getName() const
Get the name of the Window.
bool add(Curve *curve)
Add the specified curve to the plot.
void setFromDescription(const agxJson::Value &root)
set from an description of the format of getDescription.
const agx::String & getId() const
Generalized callback, using std::function.
Definition Callback.h:54
An event with no arguments.
Definition Event.h:90
Base class providing referencing counted objects.
Definition Referenced.h:120
Namespace contains functionality related to plotting.