AGX Dynamics  2.38.0.2
Window.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 #pragma once
18 
19 #include <agxPlot/Curve.h>
20 #include <agxPlot/DataPacket.h>
21 
22 #include <agx/String.h>
23 
24 namespace agxPlot
25 {
26  class System;
27 
29  {
30  public:
36  Window(const agx::String& id = "");
37 
44  bool add(Curve* curve);
45 
46  void clearCurves();
47 
53  void getNewValues(DataPacket* target);
54 
60  void getOldValues(DataPacket* target);
61 
62  System* getPlotSystem();
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 }
agxPlot::DataPacket
Package of points for a specified curve.
Definition: DataPacket.h:55
agx::Vector< CurveRef >
agxPlot
Namespace contains functionality related to plotting.
agx::Callback
Generalized callback, using std::function.
Definition: Callback.h:53
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
agxPlot::Window::representationChanged
agx::Event representationChanged
Definition: Window.h:96
DataPacket.h
agxPlot::System
System that manages the plotting system.
Definition: System.h:38
agxPlot::Window
Definition: Window.h:28
agx::root
AGXCORE_EXPORT Component * root()
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agxPlot::Curve
Definition of a plot curve.
Definition: Curve.h:36
Curve.h
String.h
agx::AgXString< std::string >
agx::Event
An event with no arguments.
Definition: Event.h:89