AGX Dynamics  2.35.0.1
Window.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 AGXPLOT_WINDOW_H
18 #define AGXPLOT_WINDOW_H
19 
20 #include <agxPlot/Curve.h>
21 #include <agxPlot/DataPacket.h>
22 
23 #include <agx/String.h>
24 
25 namespace agxPlot
26 {
27  class System;
28 
30  {
31  public:
37  Window(const agx::String& id = "");
38 
45  bool add(Curve* curve);
46 
47  void clearCurves();
48 
54  void getNewValues(DataPacket* target);
55 
61  void getOldValues(DataPacket* target);
62 
64 
72  void getDescription(agxJson::Value& root) const;
73 
77  void setFromDescription(const agxJson::Value& root);
78 
79  const agx::String& getId() const;
80 
84  const agx::String& getName() const;
88  void setName(const agx::String& name);
89 
90  void setEnabled(bool enabled);
91 
92  bool getEnabled() const;
93 
95  const CurveRefVector& getCurves() const;
96 
98  public:
99  /***************************************/
100  /* HELPER FUNCTIONS FOR CREATING PLOTS */
101  /***************************************/
102  private:
103  friend class System;
104  void setPlotSystem(System *system);
105 
106  private:
107  CurveRefVector m_curves;
108  System *m_system;
109  agx::String m_id;
110  agx::String m_name;
111  bool m_isEnabled;
112 
113  agx::Event::CallbackType m_curveRepresentationChangedCallback;
114  };
115 
118 }
119 
120 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
const agx::String & getName() const
Get the name of the Window.
Window(const agx::String &id="")
const CurveRefVector & getCurves() const
Gets the curves belonging to the window.
void setEnabled(bool enabled)
const agx::String & getId() const
void getNewValues(DataPacket *target)
Get all values that have been added since the last data push.
agx::Event representationChanged
Definition: Window.h:97
bool getEnabled() const
void getDescription(agxJson::Value &root) const
Retrieve the description, as follows.
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.
System * getPlotSystem()
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.
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:114
Namespace contains functionality related to plotting.
AGXCORE_EXPORT Component * root()