Loading...
Searching...
No Matches
tracejs.h
Go to the documentation of this file.
#pragma once
/////////////////////// stdlib includes
/////////////////////// Qt includes
#include <QObject>
#include <QtQml>
#include <QVariant>
/////////////////////// Local includes
#include "jsclassregistrar.h"
#include "pappsomspp/export-import-config.h"
#include "../trace/trace.h"
#include "datapointjs.h"
namespace pappso
{
/* BEGIN CLASS JS REFERENCE
* namespace: pappso
* class name: Trace
*/
class PMSPP_LIB_DECL TraceJs : public QObject
{
Q_OBJECT
Q_PROPERTY(int size READ getSize NOTIFY sizeChangedSignal)
QML_NAMED_ELEMENT(Trace)
public:
Q_INVOKABLE explicit TraceJs(QObject *parent = nullptr);
Q_INVOKABLE explicit TraceJs(const Trace &trace, QObject *parent = nullptr);
// Delete assignment operator (QObjects shouldn't be assigned)
TraceJs &operator=(const TraceJs &) = delete;
Q_INVOKABLE int getSize() const;
Q_INVOKABLE void append(double x, double y);
Q_INVOKABLE void append(const DataPointJs *data_point_js_p);
Q_INVOKABLE DataPointJs *getPointAt(int index) const;
Q_INVOKABLE QVariantList getTrace() const;
Q_INVOKABLE void initialize(const QVariantList &js_points);
Q_INVOKABLE void initialize(const QVariantMap &map);
Q_INVOKABLE std::size_t initialize(const QVariantList &x_values, const QVariantList &y_values);
Q_INVOKABLE std::size_t initialize(const QString &x_text, const QString &y_text);
Q_INVOKABLE std::size_t initialize(const QString &space_sep_text);
Q_INVOKABLE std::size_t initialize(const TraceJs &other);
Q_INVOKABLE QVariantList xValues() const;
Q_INVOKABLE QVariantList yValues() const;
Q_INVOKABLE QVariantMap toMap() const;
Q_INVOKABLE void clear();
// Static registration method
static void registerJsConstructor(QJSEngine *engine);
signals:
void sizeChangedSignal();
private:
Trace m_trace;
};
/* END CLASS JS REFERENCE
* namespace: pappso
* class name: Trace
*/
PAPPSO_REGISTER_JS_CLASS(pappso, TraceJs)
} // namespace pappso
pappso::DataPointJs
Definition datapointjs.h:25
pappso::TraceJs
Definition tracejs.h:27
pappso::TraceJs::append
Q_INVOKABLE void append(double x, double y)
Definition tracejs.cpp:24
pappso::TraceJs::getSize
Q_INVOKABLE int getSize() const
Definition tracejs.cpp:18
pappso::TraceJs::yValues
Q_INVOKABLE QVariantList yValues() const
Definition tracejs.cpp:183
pappso::TraceJs::getPointAt
Q_INVOKABLE DataPointJs * getPointAt(int index) const
Definition tracejs.cpp:41
pappso::TraceJs::sizeChangedSignal
void sizeChangedSignal()
pappso::TraceJs::initialize
Q_INVOKABLE void initialize(const QVariantList &js_points)
Definition tracejs.cpp:68
pappso::TraceJs::operator=
TraceJs & operator=(const TraceJs &)=delete
pappso::TraceJs::size
int size
Definition tracejs.h:29
pappso::TraceJs::clear
Q_INVOKABLE void clear()
Definition tracejs.cpp:208
pappso::TraceJs::m_trace
Trace m_trace
Definition tracejs.h:69
pappso::TraceJs::registerJsConstructor
static void registerJsConstructor(QJSEngine *engine)
Definition tracejs.cpp:214
pappso::TraceJs::xValues
Q_INVOKABLE QVariantList xValues() const
Definition tracejs.cpp:169
pappso::TraceJs::getTrace
Q_INVOKABLE QVariantList getTrace() const
Definition tracejs.cpp:54
pappso::TraceJs::TraceJs
Q_INVOKABLE TraceJs(QObject *parent=nullptr)
Definition tracejs.cpp:9
pappso::TraceJs::toMap
Q_INVOKABLE QVariantMap toMap() const
Definition tracejs.cpp:197
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:152
datapointjs.h
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
jsclassregistrar.h
PAPPSO_REGISTER_JS_CLASS
#define PAPPSO_REGISTER_JS_CLASS(NS_IDENT, CLASS_NAME)
Definition jsclassregistrar.h:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
trace.h