AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
Curve.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/DataSeries.h>
20
21#include <agx/String.h>
22#include <agx/Vec4.h>
23#include <agx/Vec2.h>
24
25namespace agxPlot
26{
30
31 class System;
32
37 {
38 public:
39 enum Line
40 {
41 LINE_SOLID = 0,
42 LINE_DASHED = 1,
43 LINE_NONE = 2
44 };
45 enum Symbol
46 {
47 SYMBOL_CROSS = 0,
48 SYMBOL_CIRCLE = 1,
49 SYMBOl_DOT = 2,
50 SYMBOl_NONE = 3
51 };
52 Curve(agxPlot::DataSeries* xValues, agxPlot::DataSeries* yValues, const agx::String& name = "");
53
54
60
66
72
76 void setName(const agx::String& name);
77 const agx::String& getName() const;
78
82 void setColor(const agx::Vec4f& color);
83 const agx::Vec4f& getColor() const;
84
88 void setLineType(Line line);
90
94 void setSymbol(Symbol symbol);
96
100 void setLineWidth(agx::Real lineWidth);
102
107
123 void getDescription(agxJson::Value& root) const;
124
130 void setFromDescription(const agxJson::Value& root, System* system);
131
132
135
138
141 private:
142 CurvePointVector getValuesFrom(size_t index) const;
143 CurvePointVector getValuesTo(size_t index) const;
144
145 void setID(CurveID id);
146 private:
147 agxPlot::DataSeriesRef m_xValues;
148 agxPlot::DataSeriesRef m_yValues;
149
150 agx::Vec4f m_color;
151 agx::String m_name;
152 Line m_lineType;
153 Symbol m_symbol;
154 agx::Real m_lineWidth;
155 CurveID m_id;
156
157 agx::Event::CallbackType m_dataSeriesRepresentationChangedCallback;
158 };
161}
#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
const agx::Vec4f & getColor() const
agxPlot::DataSeries * getDataSeriesX() const
CurveID getCurveID() const
A generated ID for the curve.
agx::Event representationChanged
Definition Curve.h:140
Curve(agxPlot::DataSeries *xValues, agxPlot::DataSeries *yValues, const agx::String &name="")
const agx::String & getName() const
Line getLineType() const
Symbol getSymbol() const
agx::Real getLineWidth() const
void setSymbol(Symbol symbol)
The type of symbol used.
void setLineType(Line line)
The type of line used.
CurvePointVector getAllValues() const
Get all currently generated values from the two DataSeries.
CurvePointVector getOldValues() const
Get all values from the DataSeries that have been generated before the last update call.
void setFromDescription(const agxJson::Value &root, System *system)
Sets the curve to match that of a description of the format from getDescription.
void setName(const agx::String &name)
The name/legend of the curve.
agxPlot::DataSeries * getDataSeriesY() const
void setColor(const agx::Vec4f &color)
The color of the curve.
CurvePointVector getNewValues() const
Get all values from the DataSeries that have been generated since the last update call.
void setLineWidth(agx::Real lineWidth)
The width of the line in pixels.
void getDescription(agxJson::Value &root) const
Retrieves the description of the curve.
Class that encapsulates data to be plotted, including methods for accessing the data,...
Definition DataSeries.h:45
System that manages the plotting system.
Definition System.h:39
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
A class holding 4 dimensional vectors and providing basic arithmetic.
Templated vector class.
Definition agx/Vector.h:53
Namespace contains functionality related to plotting.
agx::Vec2 CurvePoint
Definition Curve.h:27
agx::Vector< CurvePoint > CurvePointVector
Definition Curve.h:28
agx::UInt CurveID
Definition Curve.h:29
uint64_t UInt
Definition Integer.h:27
double Real
Definition Real.h:42