Go to the documentation of this file.
7 #ifndef PJ_PLOTDATA_BASE_H
8 #define PJ_PLOTDATA_BASE_H
13 #include <type_traits>
16 #include <unordered_map>
30 #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
58 using Attributes = std::unordered_map<PlotAttribute, QVariant>;
66 return value.type() == QVariant::Color;
68 return value.type() == QVariant::Bool;
70 return value.type() == QVariant::String;
83 using Ptr = std::shared_ptr<PlotGroup>;
89 const std::string&
name()
const
112 return (it ==
_attributes.end()) ? QVariant() : it->second;
121 template <
typename TypeX,
typename Value>
142 typedef typename std::deque<Point>::iterator
Iterator;
193 const Point&
at(
size_t index)
const
198 Point&
at(
size_t index)
235 throw std::runtime_error(
"PlotDataBase::setAttribute : wrong type");
242 return (it ==
_attributes.end()) ? QVariant() : it->second;
278 if constexpr (std::is_arithmetic_v<TypeX>)
303 if constexpr (std::is_arithmetic_v<Value>)
333 if constexpr (std::is_arithmetic_v<TypeX>)
341 if constexpr (std::is_arithmetic_v<Value>)
355 if constexpr (std::is_arithmetic_v<TypeX>)
363 if constexpr (std::is_arithmetic_v<Value>)
377 const auto& p =
_points.front();
379 if constexpr (std::is_arithmetic_v<TypeX>)
387 if constexpr (std::is_arithmetic_v<Value>)
406 mutable std::shared_ptr<PlotGroup>
_group;
411 if constexpr (std::is_arithmetic_v<TypeX>)
440 if constexpr (std::is_arithmetic_v<Value>)
PlotDataBase(const std::string &name, PlotGroup::Ptr group)
bool CheckType(PlotAttribute attr, const QVariant &value)
ConstIterator end() const
Point & operator[](size_t index)
PlotData may or may not have a group. Think of PlotGroup as a way to say that certain set of series a...
virtual ~PlotDataBase()=default
void clonePoints(const PlotDataBase &other)
const PlotGroup::Ptr & group() const
std::deque< Point >::iterator Iterator
const auto SkipEmptyParts
const Attributes & attributes() const
void setAttribute(PlotAttribute id, const QVariant &value)
const Attributes & attributes() const
PlotDataBase & operator=(const PlotDataBase &other)=delete
virtual RangeOpt rangeX() const
const Point & back() const
std::shared_ptr< PlotGroup > Ptr
ConstIterator begin() const
Attributes & attributes()
const T & move(const T &v)
QVariant attribute(const PlotAttribute &id) const
virtual void pushBack(Point &&p)
void setAttribute(const PlotAttribute &id, const QVariant &value)
virtual void insert(Iterator it, Point &&p)
virtual size_t size() const
virtual void pushBack(const Point &p)
std::unordered_map< PlotAttribute, QVariant > Attributes
std::shared_ptr< PlotGroup > _group
const std::string & name() const
virtual bool isTimeseries() const
std::optional< Range > RangeOpt
Attributes & attributes()
virtual void pushUpdateRangeX(const Point &p)
virtual void pushUpdateRangeY(const Point &p)
const Point & operator[](size_t index) const
const Point & at(size_t index) const
QVariant attribute(PlotAttribute id) const
Point(TypeX _x, Value _y)
const Point & front() const
virtual RangeOpt rangeY() const
PlotGroup(const std::string &name)
void changeGroup(PlotGroup::Ptr group)
std::deque< Point > _points
static constexpr nullopt_t nullopt
nullopt is a constant of type nullopt_t that is used to indicate optional type with uninitialized sta...
std::deque< Point >::const_iterator ConstIterator
constexpr auto isnan(T value) -> bool
const std::string & plotName() const
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45