37 Type = UserType + ParFunction
63 ParFunItem(
const QUrl& urlX = QUrl(),
const QString& nameX = QString(),
64 const QUrl& urlY = QUrl(),
const QString& nameY = QString(),
65 unsigned color = 0,
Symbol symbol = SolidLine,
double fx = 1,
66 double fy = 1, QGraphicsItem* parent =
nullptr,
double tMin = 0,
67 double tMax = 0,
double deltaT = 0,
bool visible =
true,
68 FillStyle fillStyle = NoBrush,
double xOffset = 0,
69 double yOffset = 0,
double relSize = 1);
83 ParFunItem(
const KConfigGroup* plo,
const QUrl& urlPlo,
unsigned color = 0,
84 Symbol symbol = SolidLine, QGraphicsItem* parent =
nullptr);
101 void exponent(
int& expX,
int& expY,
double& fx,
double& fy)
const;
109 void exportTable(QTextStream& stream,
char separator,
char format,
110 int precision)
const;
112 double (*funcX)(double,
const double*);
114 inline const QLibrary*
libX()
const {
return m_libX; };
122 void limits(
double& xMin,
double& xMax,
double& yMin,
double& yMax)
const;
124 inline QString
nameX()
const {
return m_nameX; };
126 virtual void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option,
127 QWidget* widget =
nullptr)
override;
129 inline double*
parX() {
return m_parX; };
138 bool setFuncX(
const QUrl& url,
const QString& name);
145 virtual void setPar(
int i,
double value,
bool yFun)
override;
147 virtual int type()
const override {
return Type; };
149 inline const QUrl&
urlX()
const {
return m_urlX; };
158 void writePlo(KConfigGroup* plo,
const QUrl& urlPlo,
bool absolute,
159 char format,
int precision)
const;
173 mutable double (*funcXo)(double,
const double*);
176 mutable QVector<double> m_xValues;
Function item class.
Definition funitem.h:40
@ Type
Specific QGraphicsItem type number of FunItem for function type().
Definition funitem.h:46
static const int NumParMax
Dimension of parameter arrays.
Definition funitem.h:43
FillStyle
Fill styles.
Definition kplitem.h:45
Symbol
Symbol types.
Definition kplitem.h:83
Parametric function item class.
Definition parfunitem.h:33
const QLibrary * libX() const
Returns pointer to library for x function.
Definition parfunitem.h:114
bool setFuncX(const QUrl &url, const QString &name)
Resolves x function address.
void unloadX()
Unloads x function library.
void exponent(int &expX, int &expY, double &fx, double &fy) const
Calculates normalization factors.
virtual int type() const override
Returns specific QGraphicsItem type number.
Definition parfunitem.h:147
QString nameX() const
Returns x function name.
Definition parfunitem.h:124
void setDashOffset()
Sets offset for dashed lines.
int calcTable() const
Calculates function value table.
ParFunItem(const KConfigGroup *plo, const QUrl &urlPlo, unsigned color=0, Symbol symbol=SolidLine, QGraphicsItem *parent=nullptr)
Constructor.
const QUrl & urlX() const
Returns URL of x function library.
Definition parfunitem.h:149
double * xValues() const
Returns pointer to x function value array.
ParFunItem(const QUrl &urlX=QUrl(), const QString &nameX=QString(), const QUrl &urlY=QUrl(), const QString &nameY=QString(), unsigned color=0, Symbol symbol=SolidLine, double fx=1, double fy=1, QGraphicsItem *parent=nullptr, double tMin=0, double tMax=0, double deltaT=0, bool visible=true, FillStyle fillStyle=NoBrush, double xOffset=0, double yOffset=0, double relSize=1)
Constructor.
void writePlo(KConfigGroup *plo, const QUrl &urlPlo, bool absolute, char format, int precision) const
Writes into plot file.
double * parX()
Returns x function parameter array pointer.
Definition parfunitem.h:129
virtual ~ParFunItem()
Destructor.
void init()
Performs initialization.
void exportTable(QTextStream &stream, char separator, char format, int precision) const
Exports function value table to file.
virtual void setPar(int i, double value, bool yFun) override
Sets parameter.
ParFunItem(const ParFunItem &a)
Copy constructor.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
Paints item.
virtual QRectF boundingRect() const override
Calculates bounding rectangle.
void paintCond(QPainter *painter) const
Paints or calculates bounding area.
void limits(double &xMin, double &xMax, double &yMin, double &yMax) const
Calculates minimum and maximum values.