mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
modernization of code: C++11, removed warnings, using templates in JKQTPDatastore
This commit is contained in:
parent
7af0c7b6d1
commit
3c8bdd71c7
@ -443,7 +443,7 @@ JKQTmathText::MTinstruction1Node::MTinstruction1Node(JKQTmathText* parent, QStri
|
||||
}
|
||||
|
||||
JKQTmathText::MTinstruction1Node::~MTinstruction1Node() {
|
||||
if (child!=NULL) delete child;
|
||||
if (child!=nullptr) delete child;
|
||||
}
|
||||
|
||||
void JKQTmathText::MTinstruction1Node::getSizeInternal(QPainter& painter, JKQTmathText::MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos) {
|
||||
@ -569,7 +569,7 @@ JKQTmathText::MTsubscriptNode::MTsubscriptNode(JKQTmathText* parent, MTnode* chi
|
||||
}
|
||||
|
||||
JKQTmathText::MTsubscriptNode::~MTsubscriptNode() {
|
||||
if (child!=NULL) delete child;
|
||||
if (child!=nullptr) delete child;
|
||||
}
|
||||
|
||||
void JKQTmathText::MTsubscriptNode::getSizeInternal(QPainter& painter, JKQTmathText::MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos) {
|
||||
@ -629,7 +629,7 @@ JKQTmathText::MTsqrtNode::MTsqrtNode(JKQTmathText* parent, MTnode* child, int de
|
||||
}
|
||||
|
||||
JKQTmathText::MTsqrtNode::~MTsqrtNode() {
|
||||
if (child!=NULL) delete child;
|
||||
if (child!=nullptr) delete child;
|
||||
}
|
||||
|
||||
void JKQTmathText::MTsqrtNode::getSizeInternal(QPainter& painter, JKQTmathText::MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos) {
|
||||
@ -711,8 +711,8 @@ JKQTmathText::MTfracNode::MTfracNode(JKQTmathText* parent, MTnode* child_top, MT
|
||||
}
|
||||
|
||||
JKQTmathText::MTfracNode::~MTfracNode() {
|
||||
if (child1!=NULL) delete child1;
|
||||
if (child2!=NULL) delete child2;
|
||||
if (child1!=nullptr) delete child1;
|
||||
if (child2!=nullptr) delete child2;
|
||||
}
|
||||
|
||||
void JKQTmathText::MTfracNode::getSizeInternal(QPainter& painter, JKQTmathText::MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos) {
|
||||
@ -990,7 +990,7 @@ double JKQTmathText::MTmatrixNode::draw(QPainter& painter, double x, double y, J
|
||||
//widths[i].resize(columns);
|
||||
//baselines[i]=heights[i]=widths[i];
|
||||
for (int j=0; j<children[i].size(); j++) {
|
||||
if (children[i].at(j)!=NULL) children[i].at(j)->getSize(painter, ev1, width1, baselineHeight1, overallHeight1, strikeoutPos);;
|
||||
if (children[i].at(j)!=nullptr) children[i].at(j)->getSize(painter, ev1, width1, baselineHeight1, overallHeight1, strikeoutPos);;
|
||||
/*widths[i].operator[](j)=width1;
|
||||
baselines[i].operator[](j)=baselineHeight;
|
||||
heights[i].operator[](j)=overallHeight1;*/
|
||||
@ -1054,7 +1054,7 @@ JKQTmathText::MTdecoratedNode::MTdecoratedNode(JKQTmathText* parent, MTdecoratio
|
||||
}
|
||||
|
||||
JKQTmathText::MTdecoratedNode::~MTdecoratedNode() {
|
||||
if (child!=NULL) delete child;
|
||||
if (child!=nullptr) delete child;
|
||||
}
|
||||
|
||||
void JKQTmathText::MTdecoratedNode::getSizeInternal(QPainter& painter, JKQTmathText::MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos) {
|
||||
@ -1209,7 +1209,7 @@ JKQTmathText::MTsuperscriptNode::MTsuperscriptNode(JKQTmathText* parent, MTnode*
|
||||
}
|
||||
|
||||
JKQTmathText::MTsuperscriptNode::~MTsuperscriptNode() {
|
||||
if (child!=NULL) delete child;
|
||||
if (child!=nullptr) delete child;
|
||||
}
|
||||
|
||||
void JKQTmathText::MTsuperscriptNode::getSizeInternal(QPainter& painter, JKQTmathText::MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos) {
|
||||
@ -1272,7 +1272,7 @@ JKQTmathText::MTbraceNode::MTbraceNode(JKQTmathText* parent, QString openbrace,
|
||||
}
|
||||
|
||||
JKQTmathText::MTbraceNode::~MTbraceNode() {
|
||||
if (child!=NULL) delete child;
|
||||
if (child!=nullptr) delete child;
|
||||
}
|
||||
|
||||
void JKQTmathText::MTbraceNode::getSizeInternal(QPainter& painter, JKQTmathText::MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos) {
|
||||
@ -1621,9 +1621,9 @@ void JKQTmathText::MTlistNode::getSizeInternal(QPainter& painter, JKQTmathText::
|
||||
} else if (smb) {
|
||||
QString s=smb->get_symbolName();
|
||||
if (subsupOperations.contains(s)) {
|
||||
MTsubscriptNode* subn=NULL;
|
||||
MTsubscriptNode* subn=nullptr;
|
||||
if (i+1<nodes.size()) subn=dynamic_cast<MTsubscriptNode*>(nodes[i+1]);
|
||||
MTsuperscriptNode* supn=NULL;
|
||||
MTsuperscriptNode* supn=nullptr;
|
||||
if (i+2<nodes.size()) supn=dynamic_cast<MTsuperscriptNode*>(nodes[i+2]);
|
||||
//std::cout<<"symbol ='"<<s.toStdString()<<"' subn="<<subn<<" supn="<<supn<<"\n";
|
||||
if (subn && supn) { // is this subscript and superscript?
|
||||
@ -1831,9 +1831,9 @@ double JKQTmathText::MTlistNode::draw(QPainter& painter, double x, double y, JKQ
|
||||
if (smb) {
|
||||
QString s=smb->get_symbolName();
|
||||
if (subsupOperations.contains(s)) {
|
||||
MTsubscriptNode* subn=NULL;
|
||||
MTsubscriptNode* subn=nullptr;
|
||||
if (i+1<nodes.size()) subn=dynamic_cast<MTsubscriptNode*>(nodes[i+1]);
|
||||
MTsuperscriptNode* supn=NULL;
|
||||
MTsuperscriptNode* supn=nullptr;
|
||||
if (i+2<nodes.size()) supn=dynamic_cast<MTsuperscriptNode*>(nodes[i+2]);
|
||||
//std::cout<<"symbol ='"<<s.toStdString()<<"' subn="<<subn<<" supn="<<supn<<"\n";
|
||||
if (subn && supn) { // is this subscript and superscript?
|
||||
@ -3082,8 +3082,8 @@ JKQTmathText::JKQTmathText(QObject* parent):
|
||||
def_expensiveRendering=expensiveRendering=true;
|
||||
useUnparsed=false;
|
||||
|
||||
parsedNode=NULL;
|
||||
unparsedNode=NULL;
|
||||
parsedNode=nullptr;
|
||||
unparsedNode=nullptr;
|
||||
|
||||
currentToken=MTTnone;
|
||||
currentTokenName="";
|
||||
@ -3093,10 +3093,10 @@ JKQTmathText::JKQTmathText(QObject* parent):
|
||||
}
|
||||
|
||||
JKQTmathText::~JKQTmathText() {
|
||||
if (parsedNode!=NULL) delete parsedNode;
|
||||
parsedNode=NULL;
|
||||
if (unparsedNode!=NULL) delete unparsedNode;
|
||||
unparsedNode=NULL;
|
||||
if (parsedNode!=nullptr) delete parsedNode;
|
||||
parsedNode=nullptr;
|
||||
if (unparsedNode!=nullptr) delete unparsedNode;
|
||||
unparsedNode=nullptr;
|
||||
}
|
||||
|
||||
void JKQTmathText::loadSettings(QSettings& settings, QString group){
|
||||
@ -3311,7 +3311,7 @@ void JKQTmathText::useLatexFonts(QString prefix, QString postfix) {
|
||||
QString JKQTmathText::toHtml(bool *ok, double fontPointSize) {
|
||||
QString s;
|
||||
bool okk=false;
|
||||
if (getTree()!=NULL) {
|
||||
if (getTree()!=nullptr) {
|
||||
MTenvironment ev;
|
||||
ev.color=fontColor;
|
||||
ev.fontSize=fontPointSize;
|
||||
@ -3477,55 +3477,55 @@ JKQTmathText::MTnode* JKQTmathText::parseLatexString(bool get, QString quitOnClo
|
||||
}
|
||||
} else if (name=="frac") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMfrac));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="dfrac") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMdfrac));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="tfrac") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMtfrac));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="stackrel") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMstackrel));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="binom") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTbraceNode(this, "(", ")", new MTfracNode(this, n1, n2, MTFMstackrel)));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="underbrace") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMunderbrace));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="underset") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMunderset));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="overbrace") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMoverbrace));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
} else if (name=="overset") {
|
||||
MTnode* n1=parseLatexString(true);
|
||||
MTnode* n2=NULL;
|
||||
MTnode* n2=nullptr;
|
||||
if (getToken()==MTTopenbrace) n2=parseLatexString(true);
|
||||
if (n1 && n2) nl->addNode(new MTfracNode(this, n1, n2, MTFMoverset));
|
||||
else error_list.append(tr("error @ ch. %1: expected two arguments in '{' braces after '%2' command").arg(currentTokenID).arg(name));
|
||||
@ -3757,8 +3757,8 @@ JKQTmathText::MTnode* JKQTmathText::parseLatexString(bool get, QString quitOnClo
|
||||
if (!parsingMathEnvironment) nl->addNode(new MTwhitespaceNode(this));
|
||||
} else if (currentToken==MTTunderscore) {
|
||||
getToken();
|
||||
MTnode* child=NULL;
|
||||
MTnode* child2=NULL;
|
||||
MTnode* child=nullptr;
|
||||
MTnode* child2=nullptr;
|
||||
if (currentToken==MTTinstruction) {
|
||||
QString name=currentTokenName;
|
||||
getToken(); // look at next token
|
||||
@ -3783,12 +3783,12 @@ JKQTmathText::MTnode* JKQTmathText::parseLatexString(bool get, QString quitOnClo
|
||||
} else {
|
||||
getNew=false;
|
||||
}
|
||||
if (child!=NULL) nl->addNode(new MTsubscriptNode(this, child));
|
||||
if (child2!=NULL) nl->addNode(child2);
|
||||
if (child!=nullptr) nl->addNode(new MTsubscriptNode(this, child));
|
||||
if (child2!=nullptr) nl->addNode(child2);
|
||||
} else if (currentToken==MTThat) {
|
||||
getToken();
|
||||
MTnode* child=NULL;
|
||||
MTnode* child2=NULL;
|
||||
MTnode* child=nullptr;
|
||||
MTnode* child2=nullptr;
|
||||
if (currentToken==MTTinstruction) {
|
||||
QString name=currentTokenName;
|
||||
getToken(); // look at next token
|
||||
@ -3813,8 +3813,8 @@ JKQTmathText::MTnode* JKQTmathText::parseLatexString(bool get, QString quitOnClo
|
||||
} else {
|
||||
getNew=false;
|
||||
}
|
||||
if (child!=NULL) nl->addNode(new MTsuperscriptNode(this, child));
|
||||
if (child2!=NULL) nl->addNode(child2);
|
||||
if (child!=nullptr) nl->addNode(new MTsuperscriptNode(this, child));
|
||||
if (child2!=nullptr) nl->addNode(child2);
|
||||
} else if (currentToken==MTTopenbrace) {
|
||||
nl->addNode(parseLatexString(true));
|
||||
} else if (currentToken==MTTclosebrace) {
|
||||
@ -3872,8 +3872,8 @@ bool JKQTmathText::parse(QString text){
|
||||
if (parsedNode && parseString==ntext) return true;
|
||||
|
||||
|
||||
if (parsedNode!=NULL) delete parsedNode;
|
||||
if (unparsedNode!=NULL) delete unparsedNode;
|
||||
if (parsedNode!=nullptr) delete parsedNode;
|
||||
if (unparsedNode!=nullptr) delete unparsedNode;
|
||||
parseString=ntext;
|
||||
|
||||
currentTokenID=-1;
|
||||
@ -3883,12 +3883,12 @@ bool JKQTmathText::parse(QString text){
|
||||
error_list.clear();
|
||||
parsedNode=parseLatexString(true);
|
||||
unparsedNode=new MTplainTextNode(this, text, false);
|
||||
return (parsedNode!=NULL);
|
||||
return (parsedNode!=nullptr);
|
||||
}
|
||||
|
||||
|
||||
QSizeF JKQTmathText::getSize(QPainter& painter){
|
||||
if (getTree()!=NULL) {
|
||||
if (getTree()!=nullptr) {
|
||||
double w=0, a=0, d=0, s=0;
|
||||
getSizeDetail(painter, w, a, d, s);
|
||||
return QSizeF(w, a+d);
|
||||
@ -3913,7 +3913,7 @@ void JKQTmathText::getSizeDetail(QPainter& painter, double& width, double& ascen
|
||||
ascent=0;
|
||||
descent=0;
|
||||
strikeoutPos=0;
|
||||
if (getTree()!=NULL) {
|
||||
if (getTree()!=nullptr) {
|
||||
MTenvironment ev;
|
||||
ev.color=fontColor;
|
||||
ev.fontSize=fontSize;
|
||||
@ -3928,7 +3928,7 @@ void JKQTmathText::getSizeDetail(QPainter& painter, double& width, double& ascen
|
||||
}
|
||||
|
||||
void JKQTmathText::draw(QPainter& painter, double x, double y, bool drawBoxes){
|
||||
if (getTree()!=NULL) {
|
||||
if (getTree()!=nullptr) {
|
||||
MTenvironment ev;
|
||||
ev.color=fontColor;
|
||||
ev.fontSize=fontSize;
|
||||
@ -3938,7 +3938,7 @@ void JKQTmathText::draw(QPainter& painter, double x, double y, bool drawBoxes){
|
||||
}
|
||||
|
||||
void JKQTmathText::draw(QPainter& painter, int flags, QRectF rect, bool drawBoxes) {
|
||||
if (getTree()!=NULL) {
|
||||
if (getTree()!=nullptr) {
|
||||
MTenvironment ev;
|
||||
ev.color=fontColor;
|
||||
ev.fontSize=fontSize;
|
||||
|
@ -139,7 +139,7 @@ class LIB_EXPORT JKQTmathText : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTmathText(QObject * parent = NULL);
|
||||
JKQTmathText(QObject * parent = nullptr);
|
||||
/** \brief class destructor */
|
||||
~JKQTmathText();
|
||||
/** \brief load the object settings from the given QSettings object with the given name prefix */
|
||||
@ -179,7 +179,7 @@ class LIB_EXPORT JKQTmathText : public QObject {
|
||||
void useLatexFonts(QString prefix=QString(""), QString postfix=QString(""));
|
||||
|
||||
/** \brief convert LaTeX to HTML. returns \c ok=true on success and \c ok=false else. */
|
||||
QString toHtml(bool* ok=NULL, double fontPointSize=10);
|
||||
QString toHtml(bool* ok=nullptr, double fontPointSize=10);
|
||||
|
||||
/*! \brief used to specify the font encoding used for drawing
|
||||
|
||||
@ -713,7 +713,7 @@ inline uint qHash(const JKQTmathText::tbrDataH& data) {
|
||||
class LIB_EXPORT JKQTMathTextLabel: public QLabel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit JKQTMathTextLabel(QWidget* parent=NULL);
|
||||
explicit JKQTMathTextLabel(QWidget* parent=nullptr);
|
||||
virtual ~JKQTMathTextLabel();
|
||||
|
||||
JKQTmathText* getMathText() const;
|
||||
|
@ -973,7 +973,7 @@ class LIB_EXPORT JKQTPcoordinateAxis: public QObject {
|
||||
|
||||
/** \brief calculates the maximum width and height (returned as QSize) of all tick labels.
|
||||
* Ascent and descent may also be returned in the two additional pointer arguments- */
|
||||
QSizeF getMaxTickLabelSize(JKQTPEnhancedPainter& painter, double* ascent=NULL, double* descent=NULL);
|
||||
QSizeF getMaxTickLabelSize(JKQTPEnhancedPainter& painter, double* ascent=nullptr, double* descent=nullptr);
|
||||
};
|
||||
|
||||
|
||||
|
@ -148,7 +148,7 @@ JKQtBasePlotter::JKQtBasePlotter(bool datastore_internal, QObject* parent, JKQTP
|
||||
QObject(parent), m_plotsModel(nullptr), xAxis(nullptr), yAxis(nullptr)
|
||||
{
|
||||
|
||||
dataColumnsListWidget=NULL;
|
||||
dataColumnsListWidget=nullptr;
|
||||
printMagnification=1.0;
|
||||
printZoomFactor=1.0;
|
||||
printSizeX_Millimeter=1.0;
|
||||
@ -157,7 +157,7 @@ JKQtBasePlotter::JKQtBasePlotter(bool datastore_internal, QObject* parent, JKQTP
|
||||
printDoUpdate=true;
|
||||
|
||||
emitPlotSignals=true;
|
||||
masterPlotter=NULL;
|
||||
masterPlotter=nullptr;
|
||||
masterSynchronizeWidth=false;
|
||||
masterSynchronizeHeight=false;
|
||||
fontSizePrintMultiplier=1;
|
||||
@ -268,7 +268,7 @@ JKQtBasePlotter::JKQtBasePlotter(bool datastore_internal, QObject* parent, JKQTP
|
||||
|
||||
JKQtBasePlotter::~JKQtBasePlotter(){
|
||||
clearGraphs(false);
|
||||
if (datastoreInternal && datastore!=NULL) delete datastore;
|
||||
if (datastoreInternal && datastore!=nullptr) delete datastore;
|
||||
delete xAxis;
|
||||
delete yAxis;
|
||||
}
|
||||
@ -279,18 +279,18 @@ void JKQtBasePlotter::setGrid(bool val) {
|
||||
};
|
||||
|
||||
void JKQtBasePlotter::useExternalDatastore(JKQTPdatastore* newStore){
|
||||
if (datastoreInternal && datastore!=NULL) {
|
||||
if (datastoreInternal && datastore!=nullptr) {
|
||||
delete datastore;
|
||||
datastore=NULL;
|
||||
datastore=nullptr;
|
||||
}
|
||||
datastore=newStore;
|
||||
datastoreInternal=false;
|
||||
};
|
||||
|
||||
void JKQtBasePlotter::useAsInternalDatastore(JKQTPdatastore* newStore){
|
||||
if (datastoreInternal && datastore!=NULL) {
|
||||
if (datastoreInternal && datastore!=nullptr) {
|
||||
delete datastore;
|
||||
datastore=NULL;
|
||||
datastore=nullptr;
|
||||
}
|
||||
datastore=newStore;
|
||||
datastoreInternal=true;
|
||||
@ -306,9 +306,9 @@ void JKQtBasePlotter::useInternalDatastore(){
|
||||
}
|
||||
|
||||
void JKQtBasePlotter::forceInternalDatastore(){
|
||||
if (datastoreInternal && datastore!=NULL) {
|
||||
if (datastoreInternal && datastore!=nullptr) {
|
||||
delete datastore;
|
||||
datastore=NULL;
|
||||
datastore=nullptr;
|
||||
}
|
||||
datastore=new JKQTPdatastore();
|
||||
datastoreInternal=true;
|
||||
@ -418,10 +418,10 @@ void JKQtBasePlotter::initSettings() {
|
||||
|
||||
void JKQtBasePlotter::zoomIn(double factor) {
|
||||
//std::cout<<(double)event->delta()/120.0<<": "<<factor<<std::endl;
|
||||
double xmin=p2x((long)round((double)plotWidth/2.0-(double)plotWidth/(2.0*factor)));
|
||||
double xmax=p2x((long)round((double)plotWidth/2.0+(double)plotWidth/(2.0*factor)));
|
||||
double ymin=p2y((long)round((double)plotHeight/2.0+(double)plotHeight/(2.0*factor)));
|
||||
double ymax=p2y((long)round((double)plotHeight/2.0-(double)plotHeight/(2.0*factor)));
|
||||
double xmin=p2x(static_cast<long>(round(static_cast<double>(plotWidth)/2.0-static_cast<double>(plotWidth)/(2.0*factor))));
|
||||
double xmax=p2x(static_cast<long>(round(static_cast<double>(plotWidth)/2.0+static_cast<double>(plotWidth)/(2.0*factor))));
|
||||
double ymin=p2y(static_cast<long>(round(static_cast<double>(plotHeight)/2.0+static_cast<double>(plotHeight)/(2.0*factor))));
|
||||
double ymax=p2y(static_cast<long>(round(static_cast<double>(plotHeight)/2.0-static_cast<double>(plotHeight)/(2.0*factor))));
|
||||
|
||||
|
||||
xAxis->setRange(xmin, xmax);
|
||||
@ -791,7 +791,7 @@ void JKQtBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
|
||||
QFontMetrics fm=fontMetrics();
|
||||
QString test="<EFBFBD>Aquator";
|
||||
int labelHeight=fm.size(Qt::TextSingleLine, test).height()*1.5;
|
||||
//if (mousePosLabel!=NULL) labelHeight=mousePosLabel->height();
|
||||
//if (mousePosLabel!=nullptr) labelHeight=mousePosLabel->height();
|
||||
iplotBorderTop=iplotBorderTop+(labelHeight-plotBorderTop)*1.1;
|
||||
}*/
|
||||
|
||||
@ -852,24 +852,24 @@ void JKQtBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
|
||||
// ENSURE ASPECT RATIO (if activated)
|
||||
////////////////////////////////////////////////////////////////////
|
||||
if (maintainAspectRatio && (!xAxis->isLogAxis()) && (!xAxis->isLogAxis())) {
|
||||
double currRatio=(double)plotWidth/(double)plotHeight;
|
||||
double currRatio=static_cast<double>(plotWidth)/static_cast<double>(plotHeight);
|
||||
double newPlotWidth=plotWidth;
|
||||
double newPlotHeight=plotHeight;
|
||||
double dx=0;
|
||||
double dy=0;
|
||||
if (currRatio!=aspectRatio) {
|
||||
if (aspectRatio>=currRatio) {
|
||||
newPlotWidth=aspectRatio*(double)plotHeight;
|
||||
newPlotWidth=aspectRatio*static_cast<double>(plotHeight);
|
||||
} else {
|
||||
newPlotHeight=(double)plotWidth/aspectRatio;
|
||||
newPlotHeight=static_cast<double>(plotWidth)/aspectRatio;
|
||||
}
|
||||
dx=plotWidth-newPlotWidth;
|
||||
dy=plotHeight-newPlotHeight;
|
||||
if (dx<0) {
|
||||
newPlotWidth=plotWidth;
|
||||
newPlotHeight=(double)plotWidth/aspectRatio;
|
||||
newPlotHeight=static_cast<double>(plotWidth)/aspectRatio;
|
||||
} else if (dy<0) {
|
||||
newPlotWidth=aspectRatio*(double)plotHeight;
|
||||
newPlotWidth=aspectRatio*static_cast<double>(plotHeight);
|
||||
newPlotHeight=plotHeight;
|
||||
}
|
||||
dx=plotWidth-newPlotWidth;
|
||||
@ -1399,12 +1399,12 @@ void JKQtBasePlotter::print(QPrinter* printer, bool displayPreview) {
|
||||
|
||||
|
||||
// select a printer
|
||||
if (p==NULL) {
|
||||
if (p==nullptr) {
|
||||
p=new QPrinter();
|
||||
p->setPrinterName(currentPrinter);
|
||||
delP=true;
|
||||
|
||||
QPrintDialog *dialog = new QPrintDialog(p, NULL);
|
||||
QPrintDialog *dialog = new QPrintDialog(p, nullptr);
|
||||
dialog->setWindowTitle(tr("Print Plot"));
|
||||
if (dialog->exec() != QDialog::Accepted) {
|
||||
delete p;
|
||||
@ -1437,7 +1437,7 @@ void JKQtBasePlotter::printpreview(QPrinter *p, bool setabsolutesize) {
|
||||
backgroundColor=exportBackgroundColor;
|
||||
lineWidthMultiplier=lineWidthPrintMultiplier;
|
||||
fontSizeMultiplier=fontSizePrintMultiplier;
|
||||
exportPreviewLabel=NULL;
|
||||
exportPreviewLabel=nullptr;
|
||||
printSizeX_Millimeter=widgetWidth;
|
||||
printSizeY_Millimeter=widgetHeight;
|
||||
printAspect=1;
|
||||
@ -1446,7 +1446,7 @@ void JKQtBasePlotter::printpreview(QPrinter *p, bool setabsolutesize) {
|
||||
printSetAbsolutePageSize=setabsolutesize;
|
||||
printKeepAbsoluteFontSizes=false;
|
||||
printScaleToPagesize=true;
|
||||
QDialog* dlg=new QDialog(NULL, Qt::WindowMinMaxButtonsHint);
|
||||
QDialog* dlg=new QDialog(nullptr, Qt::WindowMinMaxButtonsHint);
|
||||
dlg->setSizeGripEnabled(true);
|
||||
//printZoomFactor=0.95;
|
||||
//printMagnification=1.5;
|
||||
@ -1565,7 +1565,7 @@ void JKQtBasePlotter::printpreview(QPrinter *p, bool setabsolutesize) {
|
||||
printpreviewPaintRequested(p);
|
||||
}
|
||||
delete dlg;
|
||||
printPreview=NULL;
|
||||
printPreview=nullptr;
|
||||
lineWidthMultiplier=lw;
|
||||
fontSizeMultiplier=fs;
|
||||
backgroundColor=bc;
|
||||
@ -1582,7 +1582,7 @@ bool JKQtBasePlotter::printpreviewNew(QPaintDevice* paintDevice, bool setAbsolut
|
||||
backgroundColor=exportBackgroundColor;
|
||||
lineWidthMultiplier=lineWidthPrintMultiplier;
|
||||
fontSizeMultiplier=fontSizePrintMultiplier;
|
||||
exportPreviewLabel=NULL;
|
||||
exportPreviewLabel=nullptr;
|
||||
printMagnification=1.0;
|
||||
paintMagnification=1.0;
|
||||
gridPrintingCalc();
|
||||
@ -1610,7 +1610,7 @@ bool JKQtBasePlotter::printpreviewNew(QPaintDevice* paintDevice, bool setAbsolut
|
||||
printSetAbsolutePageSize=setAbsolutePaperSize;
|
||||
printKeepAbsoluteFontSizes=true;
|
||||
printScaleToPagesize=false;
|
||||
QDialog* dlg=new QDialog(NULL, Qt::WindowMinMaxButtonsHint);
|
||||
QDialog* dlg=new QDialog(nullptr, Qt::WindowMinMaxButtonsHint);
|
||||
dlg->setSizeGripEnabled(true);
|
||||
//printZoomFactor=0.95;
|
||||
//printMagnification=1.5;
|
||||
@ -1780,7 +1780,7 @@ bool JKQtBasePlotter::printpreviewNew(QPaintDevice* paintDevice, bool setAbsolut
|
||||
delete printer;
|
||||
}
|
||||
delete dlg;
|
||||
printPreview=NULL;
|
||||
printPreview=nullptr;
|
||||
lineWidthMultiplier=lw;
|
||||
fontSizeMultiplier=fs;
|
||||
backgroundColor=bc;
|
||||
@ -1793,7 +1793,7 @@ bool JKQtBasePlotter::printpreviewNew(QPaintDevice* paintDevice, bool setAbsolut
|
||||
}
|
||||
|
||||
bool JKQtBasePlotter::exportpreview(QSizeF pageSize, bool unitIsMM) {
|
||||
printPreview=NULL;
|
||||
printPreview=nullptr;
|
||||
printSizeX_Millimeter=pageSize.width();
|
||||
printSizeY_Millimeter=pageSize.height();
|
||||
printAspect=1;
|
||||
@ -1803,7 +1803,7 @@ bool JKQtBasePlotter::exportpreview(QSizeF pageSize, bool unitIsMM) {
|
||||
printSetAbsolutePageSize=true;
|
||||
printScaleToPagesize=false;
|
||||
printKeepAbsoluteFontSizes=true;
|
||||
QDialog* dlg=new QDialog(NULL, Qt::WindowMinMaxButtonsHint);
|
||||
QDialog* dlg=new QDialog(nullptr, Qt::WindowMinMaxButtonsHint);
|
||||
dlg->setSizeGripEnabled(true);
|
||||
//printZoomFactor=0.95;
|
||||
//printMagnification=1.5;
|
||||
@ -2560,7 +2560,7 @@ void JKQtBasePlotter::saveData(QString filename, QString format) {
|
||||
if (fn.isEmpty()) {
|
||||
QString selectedFilter=currentDataFileFormat;
|
||||
//qDebug()<<"before: currentSaveDirectory="<<currentSaveDirectory;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
fileformats.join(";;"),
|
||||
&selectedFilter);
|
||||
@ -2613,7 +2613,7 @@ void JKQtBasePlotter::saveAsCSV(QString filename) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
tr("Comma Separated Values (*.csv *.dat)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2629,7 +2629,7 @@ void JKQtBasePlotter::saveAsSYLK(QString filename) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
tr("SYLK spreadsheet (*.slk)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2645,7 +2645,7 @@ void JKQtBasePlotter::saveAsMatlab(QString filename) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
tr("Matlab Script (*.m)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2661,7 +2661,7 @@ void JKQtBasePlotter::saveAsDIF(QString filename) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
tr("DIF: Data Interchange Format (*.dif)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2677,7 +2677,7 @@ void JKQtBasePlotter::saveAsSemicolonSV(QString filename) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
tr("Comma Separated Values (*.csv *.dat)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2693,7 +2693,7 @@ void JKQtBasePlotter::saveAsTabSV(QString filename) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
tr("Tabulator Separated Values (*.txt)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2709,7 +2709,7 @@ void JKQtBasePlotter::saveAsGerExcelCSV(QString filename) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot Data"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot Data"),
|
||||
currentSaveDirectory,
|
||||
tr("Tabulator Separated Values (*.txt)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2725,7 +2725,7 @@ void JKQtBasePlotter::saveAsPDF(QString filename, bool displayPreview) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot"),
|
||||
currentSaveDirectory,
|
||||
tr("PDF File (*.pdf)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2759,7 +2759,7 @@ void JKQtBasePlotter::saveAsPS(QString filename, bool displayPreview) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot"),
|
||||
currentSaveDirectory,
|
||||
tr("PostScript File (*.ps)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2818,7 +2818,7 @@ void JKQtBasePlotter::saveImage(QString filename, bool displayPreview) {
|
||||
QString selFormat="";
|
||||
if (fn.isEmpty()) {
|
||||
selFormat=currentFileFormat;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot"),
|
||||
currentSaveDirectory,
|
||||
filt.join(";;"), &selFormat);
|
||||
if (!fn.isEmpty()) {
|
||||
@ -2913,7 +2913,7 @@ void JKQtBasePlotter::saveAsPixelImage(QString filename, bool displayPreview, co
|
||||
QString selFormat;
|
||||
if (fn.isEmpty()) {
|
||||
selFormat=currentFileFormat;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot"),
|
||||
currentSaveDirectory,
|
||||
filt.join(";;"), &selFormat);
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -3086,7 +3086,7 @@ void JKQtBasePlotter::saveAsSVG(QString filename, bool displayPreview) {
|
||||
loadUserSettings();
|
||||
QString fn=filename;
|
||||
if (fn.isEmpty()) {
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Plot"),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Plot"),
|
||||
currentSaveDirectory,
|
||||
tr("SVG Image (*.svg)"));
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -3147,7 +3147,7 @@ void JKQtBasePlotter::synchronizeToMaster(JKQtBasePlotter* master, bool synchron
|
||||
}
|
||||
|
||||
void JKQtBasePlotter::resetMasterSynchronization() {
|
||||
masterPlotter=NULL;
|
||||
masterPlotter=nullptr;
|
||||
masterSynchronizeHeight=false;
|
||||
masterSynchronizeWidth=false;
|
||||
}
|
||||
@ -3449,7 +3449,7 @@ void JKQtBasePlotter::plotGraphs(JKQTPEnhancedPainter& painter){
|
||||
#ifdef JKQTBP_AUTOTIMER
|
||||
JKQTPAutoOutputTimer jkaaot(QString("JKQtBasePlotter::plotGraphs"));
|
||||
#endif
|
||||
if (datastore==NULL || graphs.isEmpty()) return;
|
||||
if (datastore==nullptr || graphs.isEmpty()) return;
|
||||
//qDebug()<<"start JKQtPlotterBase::plotGraphs()";
|
||||
if (useClipping) {
|
||||
QRegion cregion(iplotBorderLeft, iplotBorderTop, plotWidth, plotHeight);
|
||||
@ -3562,7 +3562,7 @@ void JKQtBasePlotter::plotKeyContents(JKQTPEnhancedPainter& painter, double x, d
|
||||
}
|
||||
}
|
||||
} else if (keyLayout==JKQTPkeyLayoutMultiColumn) {
|
||||
//int columns=floor((double)plotWidth/(double)(key_item_width*kfm.width('X')));
|
||||
//int columns=floor(static_cast<double>(plotWidth)/(double)(key_item_width*kfm.width('X')));
|
||||
bool colfirst=true;
|
||||
|
||||
if (keyPosition==JKQTPkeyInsideTopLeft || keyPosition==JKQTPkeyInsideTopRight
|
||||
@ -3633,13 +3633,13 @@ void JKQtBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
|
||||
f.setFamily(keyFont);
|
||||
f.setPointSizeF(keyFontSize*fontSizeMultiplier);
|
||||
QFontMetricsF kfm(f);
|
||||
if (text_height!=NULL) *text_height=key_item_height*kfm.width('X');
|
||||
if (text_height!=nullptr) *text_height=key_item_height*kfm.width('X');
|
||||
if (keyLayout==JKQTPkeyLayoutOneColumn) {
|
||||
int keyHeight=graphs.size();
|
||||
double w=0;
|
||||
double h=0;
|
||||
painter.setFont(f);
|
||||
if (text_height!=NULL) *text_height=0;
|
||||
if (text_height!=nullptr) *text_height=0;
|
||||
|
||||
|
||||
for (int i=0; i<graphs.size(); i++) {
|
||||
@ -3656,10 +3656,10 @@ void JKQtBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
|
||||
}
|
||||
if (keyAutosize) {
|
||||
if (width) *width=w+(key_line_length+2.0*keyXSeparation)*kfm.width('X');
|
||||
if (text_width!=NULL) *text_width=w+2.0*kfm.width('X');
|
||||
if (text_width!=nullptr) *text_width=w+2.0*kfm.width('X');
|
||||
} else {
|
||||
if (width) *width=key_item_width*kfm.width('X');
|
||||
if (text_width!=NULL) *text_width=(key_item_width-(key_line_length+keyXSeparation))*kfm.width('X');
|
||||
if (text_width!=nullptr) *text_width=(key_item_width-(key_line_length+keyXSeparation))*kfm.width('X');
|
||||
}
|
||||
if (h>keyYSeparation*kfm.width('X')) h=h-keyYSeparation*kfm.width('X');
|
||||
if (height) *height=h;//keyHeight*key_item_height*kfm.width('X');
|
||||
@ -3670,7 +3670,7 @@ void JKQtBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
|
||||
double w=0;
|
||||
double h=0;
|
||||
painter.setFont(f);
|
||||
if (text_width!=NULL) *text_width=0;
|
||||
if (text_width!=nullptr) *text_width=0;
|
||||
|
||||
|
||||
for (int i=0; i<graphs.size(); i++) {
|
||||
@ -3688,10 +3688,10 @@ void JKQtBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
|
||||
if (h<key_item_height*kfm.width('X')) h=key_item_height*kfm.width('X');
|
||||
if (keyAutosize) {
|
||||
if (height) *height=h;
|
||||
if (text_height!=NULL) *text_height=h;
|
||||
if (text_height!=nullptr) *text_height=h;
|
||||
} else {
|
||||
if (height) *height=h;
|
||||
if (text_height!=NULL) *text_height=(key_item_height-(keyYSeparation))*kfm.width('X');
|
||||
if (text_height!=nullptr) *text_height=(key_item_height-(keyYSeparation))*kfm.width('X');
|
||||
}
|
||||
if (w>(keyXSeparation)*kfm.width('X')) w=w-(keyXSeparation)*kfm.width('X');
|
||||
if (width) *width=w;//keyHeight*key_item_height*kfm.width('X');
|
||||
@ -3736,9 +3736,9 @@ void JKQtBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
|
||||
if (keyPosition==JKQTPkeyInsideTopLeft || keyPosition==JKQTPkeyInsideTopRight
|
||||
|| keyPosition==JKQTPkeyOutsideTopLeft || keyPosition==JKQTPkeyOutsideTopRight) {
|
||||
if (keyAutosize) {
|
||||
lines=(int)floor((double)plotHeight/(double)(txtH+(keyYSeparation)*kfm.width('X')));
|
||||
lines=(int)floor(static_cast<double>(plotHeight)/(double)(txtH+(keyYSeparation)*kfm.width('X')));
|
||||
} else {
|
||||
lines=(int)floor((double)plotHeight/(double)((key_item_height+keyYSeparation)*kfm.width('X')));
|
||||
lines=(int)floor(static_cast<double>(plotHeight)/(double)((key_item_height+keyYSeparation)*kfm.width('X')));
|
||||
}
|
||||
columns=(int)ceil((double)keyHeight/(double)lines);
|
||||
lines=qMin((double)lines, keyHeight);
|
||||
@ -3752,12 +3752,12 @@ void JKQtBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
|
||||
if (width) *width=(w+(key_line_length+3.0*keyXSeparation)*kfm.width('X'))*columns;
|
||||
if (height) *height=lines*(txtH+keyYSeparation*kfm.width('X'));
|
||||
if (lines>0) *height=*height-keyYSeparation*kfm.width('X');
|
||||
if (text_width!=NULL) *text_width=w;
|
||||
if (text_width!=nullptr) *text_width=w;
|
||||
} else {
|
||||
if (width) *width=(key_item_width+2.0*keyXSeparation)*kfm.width('X')*columns;
|
||||
if (height) *height=lines*(key_item_height+keyYSeparation)*kfm.width('X');
|
||||
if (lines>0) *height=*height-keyYSeparation*kfm.width('X');
|
||||
if (text_width!=NULL) *text_width=(key_item_width-(key_line_length+keyXSeparation))*kfm.width('X');
|
||||
if (text_width!=nullptr) *text_width=(key_item_width-(key_line_length+keyXSeparation))*kfm.width('X');
|
||||
}
|
||||
#ifdef SHOW_JKQTPLOTTER_DEBUG
|
||||
qDebug()<<"getKeyExtent(): mult-column: columns="<<columns<<" lines="<<lines;
|
||||
@ -4095,7 +4095,7 @@ void JKQtBasePlotter::setAllGraphsVisible()
|
||||
|
||||
void JKQtBasePlotter::setGraphVisible(int i, bool visible)
|
||||
{
|
||||
JKQTPgraph* g=graphs.value(i, NULL);
|
||||
JKQTPgraph* g=graphs.value(i, nullptr);
|
||||
if (g) g->set_visible(visible);
|
||||
if (emitPlotSignals) emit plotUpdated();
|
||||
}
|
||||
@ -4106,7 +4106,7 @@ void JKQtBasePlotter::setOnlyGraphVisible(int gr)
|
||||
JKQTPgraph* g=graphs[i];
|
||||
g->set_visible(false);
|
||||
}
|
||||
JKQTPgraph* g=graphs.value(gr, NULL);
|
||||
JKQTPgraph* g=graphs.value(gr, nullptr);
|
||||
if (g) g->set_visible(true);
|
||||
if (emitPlotSignals) emit plotUpdated();
|
||||
}
|
||||
@ -4118,7 +4118,7 @@ void JKQtBasePlotter::setOnlyNthGraphsVisible(int start, int n)
|
||||
g->set_visible(false);
|
||||
}
|
||||
for (int i=start; i<graphs.size(); i+=n) {
|
||||
JKQTPgraph* g=graphs.value(i, NULL);
|
||||
JKQTPgraph* g=graphs.value(i, nullptr);
|
||||
if (g) g->set_visible(true);
|
||||
}
|
||||
if (emitPlotSignals) emit plotUpdated();
|
||||
@ -4221,7 +4221,7 @@ QSet<int> JKQtBasePlotter::getDataColumnsByUser() {
|
||||
|
||||
QStringList cols=getDatastore()->getColumnNames();
|
||||
|
||||
QDialog* dlg=new QDialog(NULL, Qt::WindowMinMaxButtonsHint);
|
||||
QDialog* dlg=new QDialog(nullptr, Qt::WindowMinMaxButtonsHint);
|
||||
dlg->setSizeGripEnabled(true);
|
||||
//printZoomFactor=0.95;
|
||||
//printMagnification=1.5;
|
||||
@ -4279,7 +4279,7 @@ QSet<int> JKQtBasePlotter::getDataColumnsByUser() {
|
||||
|
||||
}
|
||||
delete dlg;
|
||||
dataColumnsListWidget=NULL;
|
||||
dataColumnsListWidget=nullptr;
|
||||
|
||||
saveUserSettings();
|
||||
return set;
|
||||
@ -4306,7 +4306,7 @@ void JKQtBasePlotter::getDataColumnsByUserSave() {
|
||||
QStringList items=getDataColumnsByUserSaved.keys();
|
||||
items<<name;
|
||||
bool ok=false;
|
||||
name=QInputDialog::getItem(NULL, tr("save columns selection"), tr("name for new selection:"), items, items.size()-1, true, &ok);
|
||||
name=QInputDialog::getItem(nullptr, tr("save columns selection"), tr("name for new selection:"), items, items.size()-1, true, &ok);
|
||||
if (ok) {
|
||||
QStringList data;
|
||||
for (int i=0; i<dataColumnsListWidget->count(); i++) {
|
||||
@ -4361,7 +4361,7 @@ void JKQtBasePlotter::getDataColumnsByUserItemChanged(QListWidgetItem */*widgeti
|
||||
}
|
||||
|
||||
void JKQtBasePlotter::showPlotData() {
|
||||
QDialog* dlg=new QDialog(NULL,Qt::Dialog|Qt::WindowCloseButtonHint|Qt::WindowMinMaxButtonsHint);
|
||||
QDialog* dlg=new QDialog(nullptr,Qt::Dialog|Qt::WindowCloseButtonHint|Qt::WindowMinMaxButtonsHint);
|
||||
dlg->setWindowTitle(tr("Plot data table"));
|
||||
dlg->setSizeGripEnabled(true);
|
||||
|
||||
|
@ -202,14 +202,14 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
/** \brief used to plot LaTeX markup */
|
||||
JKQTmathText mathText;
|
||||
|
||||
/** \brief model representing all Plots in this plotter and showing their visible/invisible state */
|
||||
JKQTPPlotsModel* m_plotsModel;
|
||||
|
||||
/** \brief object used for the x-axis */
|
||||
JKQTPhorizontalAxis* xAxis;
|
||||
/** \brief object used for the y-axis */
|
||||
JKQTPverticalAxis* yAxis;
|
||||
|
||||
/** \brief model representing all Plots in this plotter and showing their visible/invisible state */
|
||||
JKQTPPlotsModel* m_plotsModel;
|
||||
|
||||
/** \brief filename for the ini file in which to save the user settings
|
||||
* \see jkqtplotter_base_userprops
|
||||
*/
|
||||
@ -502,7 +502,7 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
*
|
||||
* The implementation in here returns zero size!
|
||||
*/
|
||||
virtual void getKeyExtent(JKQTPEnhancedPainter& painter, double *width, double *height, double *text_width=NULL, double *text_height=NULL, int *columns_count=NULL, int* lines_count=NULL);
|
||||
virtual void getKeyExtent(JKQTPEnhancedPainter& painter, double *width, double *height, double *text_width=nullptr, double *text_height=nullptr, int *columns_count=nullptr, int* lines_count=nullptr);
|
||||
/** \brief QAction which triggers saving of the plot as an image */
|
||||
QAction* actSavePlot;
|
||||
/** \brief QAction which triggers saving of the data used for the plot */
|
||||
@ -689,8 +689,8 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
/** \brief save the current plot data as a Semicolon Separated Values (CSV) file for german Excel, i.e. with comma as decimal separator*/
|
||||
virtual void saveAsGerExcelCSV(QString filename=QString(""));
|
||||
|
||||
/** \brief print the current plot, if printer is \c NULL a printer selection dialog is displayed */
|
||||
void print(QPrinter* printer=NULL, bool displayPreview=true);
|
||||
/** \brief print the current plot, if printer is \c nullptr a printer selection dialog is displayed */
|
||||
void print(QPrinter* printer=nullptr, bool displayPreview=true);
|
||||
|
||||
/** \brief this method zooms the graph so that all plotted datapoints are visible.
|
||||
*
|
||||
@ -711,7 +711,7 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
/** \brief zooms out of the graph (the same as turning the mouse wheel) by the given factor */
|
||||
void zoomOut(double factor=2.0) {
|
||||
zoomIn(1.0/factor);
|
||||
};
|
||||
}
|
||||
|
||||
/** \brief set the datarange of all current graphs to the given values */
|
||||
void setGraphsDataRange(long long datarange_start, long long datarange_end);
|
||||
@ -749,7 +749,7 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
* will be managed (freed) by this class. If \a datastore_internal is \c false the class will use tha datastore provided
|
||||
* in \a datast as an external datastore. You can modify this later by using useInternalDatastore() and useExternalDatastore().
|
||||
*/
|
||||
JKQtBasePlotter(bool datastore_internal=true, QObject* parent=NULL, JKQTPdatastore* datast=NULL);
|
||||
JKQtBasePlotter(bool datastore_internal=true, QObject* parent=nullptr, JKQTPdatastore* datast=nullptr);
|
||||
|
||||
/** \brief class destructor */
|
||||
virtual ~JKQtBasePlotter();
|
||||
@ -901,16 +901,16 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
void setAbsoluteXY(double xminn, double xmaxx, double yminn, double ymaxx);
|
||||
|
||||
/** \brief returns the absolute x-axis min */
|
||||
inline double getAbsoluteXMin() const {return xAxis->getAbsoluteMin(); };
|
||||
inline double getAbsoluteXMin() const {return xAxis->getAbsoluteMin(); }
|
||||
|
||||
/** \brief returns the absolute x-axis max */
|
||||
inline double getAbsoluteXMax() const {return xAxis->getAbsoluteMax(); };
|
||||
inline double getAbsoluteXMax() const {return xAxis->getAbsoluteMax(); }
|
||||
|
||||
/** \brief returns the absolute y-axis min */
|
||||
inline double getAbsoluteYMin() const {return yAxis->getAbsoluteMin(); };
|
||||
inline double getAbsoluteYMin() const {return yAxis->getAbsoluteMin(); }
|
||||
|
||||
/** \brief returns the absolute y-axis max */
|
||||
inline double getAbsoluteYMax() const {return yAxis->getAbsoluteMax(); };
|
||||
inline double getAbsoluteYMax() const {return yAxis->getAbsoluteMax(); }
|
||||
|
||||
|
||||
/** \brief add a new plotter for grid printing mode */
|
||||
@ -920,32 +920,32 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
i.y=y;
|
||||
i.plotter=plotter;
|
||||
gridPrintingList.push_back(i);
|
||||
};
|
||||
}
|
||||
|
||||
/** \brief clear all additional plotters for grid printing mode */
|
||||
inline void clearGridPrintingPlotters() {
|
||||
gridPrintingList.clear();
|
||||
};
|
||||
}
|
||||
|
||||
/** \brief return x-pixel coordinate from time coordinate */
|
||||
inline double x2p(double x) const {
|
||||
return xAxis->x2p(x);
|
||||
};
|
||||
}
|
||||
|
||||
/** \brief return y-pixel coordinate from y coordinate */
|
||||
inline double y2p(double y) const {
|
||||
return yAxis->x2p(y);
|
||||
};
|
||||
}
|
||||
|
||||
/** \brief return time coordinate coordinate from x-pixel */
|
||||
inline double p2x(long x) const {
|
||||
return xAxis->p2x(x);
|
||||
};
|
||||
}
|
||||
|
||||
/** \brief return y coordinate coordinate from y-pixel */
|
||||
inline double p2y(long y) const {
|
||||
return yAxis->p2x(y);
|
||||
};
|
||||
}
|
||||
|
||||
/** \brief gets the next unused style id, i.e. the smalles number >=0 which is not contained in usedStyles */
|
||||
int getNextStyle();
|
||||
@ -1066,11 +1066,11 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
JKQTPGET_MACRO(int, iplotBorderRight)
|
||||
JKQTPGET_MACRO(int, plotWidth)
|
||||
JKQTPGET_MACRO(int, plotHeight)
|
||||
inline JKQTmathText* get_mathText() { return &mathText; };
|
||||
inline JKQTPhorizontalAxis* getXAxis() { return xAxis; };
|
||||
inline JKQTPverticalAxis* getYAxis() { return yAxis; };
|
||||
inline JKQTPhorizontalAxis* get_xAxis() { return xAxis; };
|
||||
inline JKQTPverticalAxis* get_yAxis() { return yAxis; };
|
||||
inline JKQTmathText* get_mathText() { return &mathText; }
|
||||
inline JKQTPhorizontalAxis* getXAxis() { return xAxis; }
|
||||
inline JKQTPverticalAxis* getYAxis() { return yAxis; }
|
||||
inline JKQTPhorizontalAxis* get_xAxis() { return xAxis; }
|
||||
inline JKQTPverticalAxis* get_yAxis() { return yAxis; }
|
||||
|
||||
|
||||
JKQTPGET_MACRO(QAction*, actSavePlot)
|
||||
@ -1346,7 +1346,7 @@ class LIB_EXPORT JKQtBasePlotter: public QObject {
|
||||
/** \brief add a new overlay elements from a QList */
|
||||
void addOverlayElements(const QList<JKQTPoverlayElement*>& gr);
|
||||
|
||||
QVector<QLineF> getBoundingLinesX1Y1(QRectF *rect=NULL) const;
|
||||
QVector<QLineF> getBoundingLinesX1Y1(QRectF *rect=nullptr) const;
|
||||
|
||||
signals:
|
||||
/** \brief signal: emitted whenever the user selects a new x-y zoom range (by mouse) */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -165,7 +165,7 @@ class LIB_EXPORT JKQTPdatastore{
|
||||
|
||||
/** \brief returns the JKQTPdatastoreItem object for the \a i -th item in the store */
|
||||
inline JKQTPdatastoreItem* getItem(size_t i) const {
|
||||
return items.value(i, NULL);
|
||||
return items.value(i, nullptr);
|
||||
}
|
||||
|
||||
/** \brief add a new item to the datastore and return its ID */
|
||||
@ -173,617 +173,309 @@ class LIB_EXPORT JKQTPdatastore{
|
||||
|
||||
|
||||
/** \brief add a new columns/item with \a rows rows to the datastore and return its ID. The item uses internal memory management. */
|
||||
size_t addItem(unsigned long long rows);
|
||||
size_t addItem(size_t rows);
|
||||
|
||||
/** \brief delete the given column, if no other columns points to the datastore item of the column and \a removeItems is \c true, the item will be removed */
|
||||
void deleteColumn(size_t column, bool removeItems=true);
|
||||
|
||||
/** \brief delete all columns with the given name, if no other columns points to the datastore item of the column and \a removeItems is \c true, the item will be removed */
|
||||
void deleteAllColumns(QString name, bool removeItems=true);
|
||||
void deleteAllColumns(const QString& name, bool removeItems=true);
|
||||
|
||||
/** \brief delete all columns where the name starts with a given prefix, if no other columns points to the datastore item of the column and \a removeItems is \c true, the item will be removed */
|
||||
void deleteAllPrefixedColumns(QString prefix, bool removeItems=true);
|
||||
|
||||
/** \brief add a new item with \a rows rows and \a columns columns to the datastore and return its ID. The item uses internal memory management. */
|
||||
size_t addItem(size_t columns, unsigned long long rows);
|
||||
size_t addItem(size_t columns, size_t rows);
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows.*/
|
||||
size_t addItem(double* data, unsigned long long rows);
|
||||
size_t addItem(double* data, size_t rows);
|
||||
/** \brief add one internal column to the datastore. It contains \a rows rows.*/
|
||||
size_t addInternalItem(double* data, unsigned long long rows);
|
||||
size_t addInternalItem(double* data, size_t rows);
|
||||
|
||||
/** \brief add an external memory block to the datastore. It contains \a rows rows and \a columns columns. \a dataformat determined the memory layout*/
|
||||
size_t addItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, unsigned long long rows);
|
||||
size_t addItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, size_t rows);
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The data is copied and the copy managed internally */
|
||||
size_t addCopiedItem(const double *data, unsigned long long rows);
|
||||
size_t addCopiedItem(const double *data, size_t rows);
|
||||
|
||||
/** \brief add one external data block to the datastore. It contains \a rows rows and \a columns columns. The data is copied and the copy managed internally */
|
||||
size_t addCopiedItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, unsigned long long rows);
|
||||
size_t addCopiedItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, size_t rows);
|
||||
|
||||
|
||||
|
||||
/** \brief returns the value at position (\c column, \c row). \c column is the logical column and will be mapped to the according memory block internally!) */
|
||||
double get(size_t column, unsigned long long row) const;
|
||||
/** \brief gets the of the datapoint with the nearest, but lower value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column)*/
|
||||
long long getNextLowerIndex(size_t column, unsigned long long row, long long start, long long end) const;
|
||||
/** \brief gets the of the datapoint with the nearest, but lower value in the column */
|
||||
long long getNextLowerIndex(size_t column, unsigned long long row) const;
|
||||
double get(size_t column, size_t row) const;
|
||||
/** \brief gets the index of the datapoint with the nearest, but lower value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column)*/
|
||||
long long getNextLowerIndex(size_t column, size_t row, long long start, long long end) const;
|
||||
/** \brief gets the index of the datapoint with the nearest, but lower value in the column */
|
||||
long long getNextLowerIndex(size_t column, size_t row) const;
|
||||
/** \brief gets the index of the datapoint with the nearest, but higher value in the column (in a given inclusive row range [start ... end] values of -1 for the ranges are "wildcards", i.e. start/end of column) */
|
||||
long long getNextHigherIndex(size_t column, unsigned long long row, long long start, long long end) const;
|
||||
long long getNextHigherIndex(size_t column, size_t row, long long start, long long end) const;
|
||||
/** \brief gets the index of the datapoint with the nearest, but higher value in the column */
|
||||
long long getNextHigherIndex(size_t column, unsigned long long row) const;
|
||||
long long getNextHigherIndex(size_t column, size_t row) const;
|
||||
|
||||
/** \brief sets the value at position (\c column, \c row). \c column is the logical column and will be mapped to the according memory block internally!) */
|
||||
void set(size_t column, unsigned long long row, double value);
|
||||
void set(size_t column, size_t row, double value);
|
||||
|
||||
|
||||
|
||||
/** \brief add a new columns which references a specified item and a specified column therein. */
|
||||
size_t addColumnForItem(size_t itemID, size_t columnInItem, QString name=QString(""));
|
||||
size_t addColumnForItem(size_t itemID, size_t columnInItem, const QString& name=QString(""));
|
||||
|
||||
/** \brief add a new columns with \a rows rows to the datastore and return its column ID. The new item uses internal memory management. */
|
||||
size_t addColumn(unsigned long long rows, QString name=QString(""));
|
||||
size_t addColumn(size_t rows, const QString& name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. This returns its logical column ID.*/
|
||||
size_t addColumn(double* data, unsigned long long rows, QString name=QString(""));
|
||||
size_t addColumn(double* data, size_t rows, const QString& name=QString(""));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief copies the given \A old_column into a new one, reading the data with the given start column and stride */
|
||||
size_t copyColumn(size_t old_column, unsigned long long start, unsigned long long stride, QString name=QString(""));
|
||||
size_t copyColumn(size_t old_column, size_t start, size_t stride, const QString& name=QString(""));
|
||||
/** \brief copies the given \A old_column into a new one */
|
||||
size_t copyColumn(size_t old_column, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const double* data, unsigned long long rows, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const double* data, unsigned long long rows, unsigned long long stride, QString name=QString(""));
|
||||
size_t copyColumn(size_t old_column, const QString& name=QString(""));
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<double>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<double>& data, QString name, unsigned long long stride);
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<float>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<bool>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<uint8_t>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<uint16_t>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<uint32_t>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<uint64_t>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<int8_t>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<int16_t>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<int32_t>& data, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedColumn(const QVector<int64_t>& data, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
/** \brief add one external column to the datastore. It will be filled with the contents of vector \a data.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
* \tparam TContainer datatype of the container, which need to support standard C++ iterators and the function \c size(). The contents needs to be convertible to double.
|
||||
* \param data data vector to be copied
|
||||
* \param name name for the column
|
||||
* \return the ID of the newly created column
|
||||
*/
|
||||
size_t addCopiedColumn(const bool* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const uint8_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const uint16_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const uint32_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const int8_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const int16_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const int32_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const int64_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const uint64_t* data, unsigned long long rows, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumn(const float* data, unsigned long long rows, QString name=QString(""));
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const float* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<float>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
template <typename TContainer>
|
||||
size_t addCopiedColumn(const TContainer& data, const QString& name=QString("")) {
|
||||
const size_t N=data.size();
|
||||
double* d=static_cast<double*>(malloc(static_cast<size_t>(N)*sizeof(double)));
|
||||
if (N>0) {
|
||||
size_t r=0;
|
||||
for (auto it=data.begin(); it!=data.end(); ++it) {
|
||||
d[r]=jkqtp_todouble(*it);
|
||||
r++;
|
||||
}
|
||||
}
|
||||
size_t itemid=addInternalItem(d, N);
|
||||
return addColumnForItem(itemid, 0, name);
|
||||
}
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
/** \brief add one external column to the datastore. It will be filled with the contents of vector \a data.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
* \tparam TContainer datatype of the container, which need to support standard C++ iterators and the function \c size(). The contents needs to be convertible to double.
|
||||
* \param data data vector to be copied
|
||||
* \param name name for the column
|
||||
* \param stride strides through the container \a data with the given stride
|
||||
* \param start starts copying from \a data with the element \a start
|
||||
* \return the ID of the newly created column
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const double* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<double>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
template <typename TContainer>
|
||||
size_t addCopiedColumn(const TContainer& data, const QString& name, size_t stride, size_t start=0) {
|
||||
const size_t N=(data.size()-start)/stride;
|
||||
double* d=static_cast<double*>(malloc(static_cast<size_t>(N)*sizeof(double)));
|
||||
if (N>0) {
|
||||
size_t r=0;
|
||||
auto it=data.begin();
|
||||
if (start>0) it+=start;
|
||||
for (; it!=data.end(); it+=stride) {
|
||||
d[r]=jkqtp_todouble(*it);
|
||||
r++;
|
||||
}
|
||||
}
|
||||
size_t itemid=addInternalItem(d, N);
|
||||
return addColumnForItem(itemid, 0, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
/** \brief copy an external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \tparam T datatype of the element in the vector, this has to be convertible to double!
|
||||
* \param data pointer to the data to be copied
|
||||
* \param name name for the column
|
||||
* \return the ID of the newly created column
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const uint8_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<uint8_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
template<typename T>
|
||||
size_t addCopiedColumn(const T* data, size_t rows, const QString& name=QString("")){
|
||||
double* d=static_cast<double*>(malloc(static_cast<size_t>(rows)*sizeof(double)));
|
||||
if (data) {
|
||||
for (size_t r=0; r<rows; r++) {
|
||||
d[r]=jkqtp_todouble(data[r]);
|
||||
}
|
||||
}
|
||||
size_t itemid=addInternalItem(d, rows);
|
||||
return addColumnForItem(itemid, 0, name);
|
||||
}
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
/** \brief copy an external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \tparam T datatype of the element in the vector, this has to be convertible to double!
|
||||
* \param data pointer to the data to be copied
|
||||
* \param rows number of items to copy from \a data
|
||||
* \param stride when copying, this function steps throught the data with the given stride, so only eleemnts <code>[start, start+stride, start+2*stride, ... start+(rows-1)*stride]</code> are copied!
|
||||
* \param start first element to copy
|
||||
* \param name name for the column
|
||||
* \return the ID of the newly created column
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const int8_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<int8_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
template<typename T>
|
||||
size_t addCopiedColumn(const T* data, size_t rows, size_t stride, int start, const QString& name) {
|
||||
double* d=static_cast<double*>(malloc(static_cast<size_t>(rows)*sizeof(double)));
|
||||
if (data) {
|
||||
for (size_t r=0; r<rows; r++) {
|
||||
d[r]=jkqtp_todouble(data[static_cast<size_t>(start+static_cast<int64_t>(r*stride))]);
|
||||
}
|
||||
}
|
||||
size_t itemid=addInternalItem(d, rows);
|
||||
return addColumnForItem(itemid, 0, name);
|
||||
}
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
/** \brief copy an external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \tparam T datatype of the element in the vector, this has to be convertible to double!
|
||||
* \param data pointer to the data to be copied
|
||||
* \param name name for the column
|
||||
* \param stride when copying, this function steps throught the data with the given stride, so only eleemnts <code>[0, stride, 2*stride, ... (rows-1)*stride]</code> are copied!
|
||||
* \return the ID of the newly created column
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const int16_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<int16_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
template<typename T>
|
||||
size_t addCopiedColumn(const T* data, size_t rows, size_t stride, const QString& name) {
|
||||
return addCopiedColumn<T>(data, rows, stride, 0, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const uint16_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<uint16_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const int32_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<int32_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const uint32_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<uint32_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const uint64_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<uint64_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const int64_t* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<int64_t>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
size_t addCopiedColumnMasked(const bool* data, const bool* mask, unsigned long long rows, QString name=QString(""), bool useIfMaskEquals=false);
|
||||
|
||||
/** \brief add one external column to the datastore. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
inline size_t addCopiedColumnMasked(const QVector<bool>& data, const QVector<bool>& mask, QString name=QString(""), bool useIfMaskEquals=false) {
|
||||
return addCopiedColumnMasked(data.data(), mask.data(), qMin(data.size(), mask.size()), name, useIfMaskEquals);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const double* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
template <typename T>
|
||||
inline size_t addCopiedImageAsColumn(const T* data, size_t width, size_t height, const QString& name=QString(""), size_t stride=0, size_t start=0){
|
||||
return addCopiedColumn<T>(data, width*height, stride, start, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const double* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<double>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<double>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const float* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
template <typename TContainer>
|
||||
inline size_t addCopiedImageAsColumn(const TContainer& data, size_t /*width*/, const QString& name=QString("")){
|
||||
return addCopiedColumn<TContainer>(data, name);
|
||||
}
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const float* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<float>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
template <typename T>
|
||||
size_t addCopiedImageAsColumnTranspose(const T* data, size_t width, size_t height, const QString& name=QString(""), size_t stride=0, size_t start=0){
|
||||
double* temp=static_cast<T*>(malloc(width*height*sizeof(T)));
|
||||
|
||||
for (size_t x=0; x<width; x++) {
|
||||
for (size_t y=0; y<height; y++) {
|
||||
temp[x*height+y]=data[start+(y*width+x)*stride];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
size_t idx=addCopiedColumn(temp, width*height, name);
|
||||
free(temp);
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<float>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
template <typename T>
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<T>& data, size_t width, const QString& name=QString("")){
|
||||
return addCopiedImageAsColumnTranspose<T>(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const bool *data, unsigned long long width, unsigned long long height, QString name=QString("")) {
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
/** \brief add one external column to the datastore. It contains \a rows rows. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.
|
||||
*
|
||||
* \note This function converts the input array \a data into an array of double!
|
||||
*/
|
||||
template <typename T>
|
||||
size_t addCopiedColumnMasked(const T* data, const bool* mask, size_t rows, const QString& name=QString(""), bool useIfMaskEquals=false) {
|
||||
double* d=static_cast<double*>(calloc(rows, sizeof(double)));
|
||||
size_t rrs=0;
|
||||
if (data) {
|
||||
for (size_t r=0; r<rows; r++) {
|
||||
if (!mask || (mask && (mask[r]==useIfMaskEquals))) {
|
||||
d[rrs]=jkqtp_todouble(data[r]);
|
||||
rrs++;
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const bool* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<bool>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<bool>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
size_t col= addCopiedColumn(d, rrs, name);
|
||||
free(d);
|
||||
return col;
|
||||
}
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const uint64_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
/** \brief add one external column to the datastore. It will be filled with the contents of vector \a data.
|
||||
*
|
||||
* \tparam TContainer datatype of the container, which need to support standard C++ iterators and the function \c size(). The contents needs to be convertible to double.
|
||||
* \param data data vector to be copied
|
||||
* \param name name for the column
|
||||
* \param stride strides through the container \a data with the given stride
|
||||
* \param start starts copying from \a data with the element \a start
|
||||
* \return the ID of the newly created column
|
||||
*/
|
||||
template <typename TContainer, typename TContainerMask>
|
||||
size_t addCopiedColumnMasked(const TContainer& data, const TContainerMask& mask, const QString& name=QString(""), bool useIfMaskEquals=false) {
|
||||
const size_t N=data.size();
|
||||
double* d=static_cast<double*>(malloc(static_cast<size_t>(N)*sizeof(double)));
|
||||
size_t rrs=0;
|
||||
if (data) {
|
||||
auto itmask=mask.begin();
|
||||
auto itdata=data.begin();
|
||||
for (size_t r=0; r<N; r++) {
|
||||
if ((*itmask)==useIfMaskEquals) {
|
||||
d[rrs]=jkqtp_todouble(*itdata);
|
||||
rrs++;
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const uint64_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<uint64_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
++itmask;
|
||||
++itdata;
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<uint64_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
size_t col= addCopiedColumn(d, rrs, name);
|
||||
free(d);
|
||||
return col;
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const int64_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const int64_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<int64_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<int64_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const uint32_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const uint32_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<uint32_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<uint32_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const int32_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const int32_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<int32_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<int32_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const uint16_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const uint16_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<uint16_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<uint16_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const int16_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const int16_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<int16_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<int16_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const uint8_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const uint8_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<uint8_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<uint8_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const int8_t* data, unsigned long long width, unsigned long long height, QString name=QString("")){
|
||||
return addCopiedColumn(data, width*height, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
size_t addCopiedImageAsColumnTranspose(const int8_t* data, unsigned long long width, unsigned long long height, QString name=QString(""));
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a row-major image and is copied as such. The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumn(const QVector<int8_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumn(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add one external column to the datastore. It contains \a width * \a height rows. The external data is assumed to be organized as a column-major image and is copied as row-major (i.e. is transposed). The external data is copied to an internal array, so
|
||||
* afterwards you can delete the external arrayThis returns its logical column ID.*/
|
||||
inline size_t addCopiedImageAsColumnTranspose(const QVector<int8_t>& data, unsigned long long width, QString name=QString("")) {
|
||||
return addCopiedImageAsColumnTranspose(data.data(), width, data.size()/width, name);
|
||||
}
|
||||
/** \brief add a column to the datastore that contains \a rows rows with increasing value starting at \a start and ending at \a end.
|
||||
* the values are equidistant between \a start end \a end */
|
||||
size_t addLinearColumn(unsigned long long rows, double start, double end, QString name=QString(""));
|
||||
size_t addLinearColumn(size_t rows, double start, double end, const QString& name=QString(""));
|
||||
|
||||
/** \brief returns the number of (logical) columns currently managed by the datastore */
|
||||
inline size_t getColumnCount() { return columns.size(); }
|
||||
inline size_t getColumnCount() { return static_cast<size_t>(columns.size()); }
|
||||
|
||||
inline QList<size_t> getColumnIDs() { return columns.keys(); }
|
||||
|
||||
/** \brief return the num of the first column with the given name, or -1 if none was found */
|
||||
int getColumnNum(QString name);
|
||||
int getColumnNum(const QString& name);
|
||||
|
||||
/** \brief return the num of the first column with the given name, if none was found this creates a new column with no rows and returns its num */
|
||||
size_t ensureColumnNum(QString name);
|
||||
size_t ensureColumnNum(const QString& name);
|
||||
|
||||
/** \brief returns the JKQTPcolumn object for the \a i -th column in the store */
|
||||
JKQTPcolumn getColumn(size_t i) const;
|
||||
|
||||
/** \brief returns the maximum number of rows in all columns */
|
||||
unsigned long long getMaxRows();
|
||||
size_t getMaxRows();
|
||||
|
||||
/** \brief save contents of datastore as Comma Separated Values (CSV) file
|
||||
*
|
||||
@ -832,10 +524,10 @@ class LIB_EXPORT JKQTPdatastore{
|
||||
|
||||
/** \brief return contents of datastore as QList<QVector<double> >, i.e. a list of column-vectors
|
||||
*
|
||||
* \param columnNames if \c !=NULL this will afterwards conatin the column titles
|
||||
* \param columnNames if \c !=nullptr this will afterwards conatin the column titles
|
||||
* \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames()
|
||||
*/
|
||||
QList<QVector<double> > getData(QStringList* columnNames=NULL, QSet<int> userColumns=QSet<int>());
|
||||
QList<QVector<double> > getData(QStringList* columnNames=nullptr, QSet<int> userColumns=QSet<int>());
|
||||
|
||||
/** \brief save contents of datastore as <a href="http://www.fileformat.info/format/dif/egff.htm">DIF file (data interchange format)</a>
|
||||
*
|
||||
@ -860,10 +552,12 @@ class LIB_EXPORT JKQTPdatastore{
|
||||
|
||||
/** \brief return a list with all columns available in the datastore */
|
||||
QStringList getColumnNames() const;
|
||||
size_t addInternalColumn(double *data, unsigned long long rows, QString name);
|
||||
size_t addInternalColumn(double *data, size_t rows, const QString& name);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief stores information about one data column. See JKQTPdatastore for more information.
|
||||
* \ingroup jkqtpdatastorage
|
||||
*
|
||||
@ -874,7 +568,7 @@ class LIB_EXPORT JKQTPcolumn {
|
||||
/** \brief index of the item in the datastore that contains the data for this column */
|
||||
size_t datastoreItem;
|
||||
/** \brief offset, if the datastore item contains more than one column */
|
||||
unsigned long long datastoreOffset;
|
||||
size_t datastoreOffset;
|
||||
/** \brief a name describing the column */
|
||||
QString name;
|
||||
/** \brief pointer to the datastore object used to manage the data of the plot */
|
||||
@ -885,37 +579,27 @@ class LIB_EXPORT JKQTPcolumn {
|
||||
protected:
|
||||
JKQTPGET_MACRO(JKQTPdatastore*, datastore)
|
||||
public:
|
||||
JKQTPcolumn() {
|
||||
datastore=NULL;
|
||||
name="";
|
||||
datastoreItem=0;
|
||||
datastoreOffset=0;
|
||||
valid=false;
|
||||
};
|
||||
JKQTPcolumn();
|
||||
/** \brief class constructor that binds the column to a specific datastore object.
|
||||
*
|
||||
* The use of this constructor is mandatory. The default constructor (no arguments) is hidden. Also note
|
||||
* that you cannot change the binding of a column to a datastore object after creation of the column.
|
||||
*/
|
||||
JKQTPcolumn(JKQTPdatastore* datastore, QString name=QString(""), size_t datastoreItem=0, unsigned long long datastoreOffset=0) {
|
||||
this->datastore=datastore;
|
||||
this->datastoreItem=datastoreItem;
|
||||
this->datastoreOffset=datastoreOffset;
|
||||
this->name=name;
|
||||
valid=true;
|
||||
}
|
||||
JKQTPcolumn(JKQTPdatastore* datastore, const QString& name=QString(""), size_t datastoreItem=0, size_t datastoreOffset=0);
|
||||
|
||||
inline bool isValid() const { return valid; }
|
||||
|
||||
/** \brief class destructor */
|
||||
virtual ~JKQTPcolumn() {}
|
||||
virtual ~JKQTPcolumn() ;
|
||||
|
||||
JKQTPGET_SET_MACRO(QString, name)
|
||||
|
||||
/** \brief returns the number of rows in this column (accesses the datastore) */
|
||||
unsigned long long getRows() const;
|
||||
size_t getRows() const;
|
||||
|
||||
/** \brief copies the contained data into a QVector */
|
||||
void copyData(QVector<double>& copyTo) const;
|
||||
/** \brief returns a QVector with the contained data (as a copy) */
|
||||
QVector<double> copyData();
|
||||
|
||||
/** \brief reads the \a n'th value from the column
|
||||
@ -923,17 +607,17 @@ class LIB_EXPORT JKQTPcolumn {
|
||||
* This method accesses the datastore and returns the double value stored in the \a n'th row of the according
|
||||
* column.
|
||||
*/
|
||||
double getValue(unsigned long long n) const;
|
||||
double getValue(size_t n) const;
|
||||
/** \brief gets a pointer to the n-th value in the column
|
||||
*/
|
||||
double* getPointer(unsigned long long n=0) const ;
|
||||
double* getPointer(size_t n=0) const ;
|
||||
|
||||
/** \brief sets the \a n'th value from the column
|
||||
*
|
||||
* This method accesses the datastore and returns the double value stored in the \a n'th row of the according
|
||||
* column.
|
||||
*/
|
||||
void setValue(unsigned long long n, double val) ;
|
||||
void setValue(size_t n, double val) ;
|
||||
|
||||
/** \brief returns a pointer to the datastore item representing this column */
|
||||
inline JKQTPdatastoreItem* getDatastoreItem() const { return datastore->getItem(datastoreItem); }
|
||||
@ -943,7 +627,7 @@ class LIB_EXPORT JKQTPcolumn {
|
||||
* This copies \a N elements from \a data into the column where the first overwritten column
|
||||
* line is \a offset, so you can shift the location where the copy process starts.
|
||||
*/
|
||||
void copy(double* data, unsigned long long N, unsigned long long offset=0);
|
||||
void copy(double* data, size_t N, size_t offset=0);
|
||||
|
||||
/** \brief exchange everz occurence of a given \a value by a \a replace value */
|
||||
void exchange(double value, double replace);
|
||||
@ -954,7 +638,7 @@ class LIB_EXPORT JKQTPcolumn {
|
||||
void scale(double factor);
|
||||
|
||||
JKQTPGET_MACRO(size_t, datastoreItem)
|
||||
JKQTPGET_MACRO(unsigned long long, datastoreOffset)
|
||||
JKQTPGET_MACRO(size_t, datastoreOffset)
|
||||
};
|
||||
|
||||
|
||||
@ -990,7 +674,7 @@ class LIB_EXPORT JKQTPdatastoreItem {
|
||||
/** \brief as data may also point to a matrix, this specifies the number of columns in this element (default: 1) */
|
||||
size_t columns;
|
||||
/** \brief number of rows in this item */
|
||||
unsigned long long rows;
|
||||
size_t rows;
|
||||
/** \brief memory format of the data in this item */
|
||||
JKQTPdatastoreItemFormat dataformat;
|
||||
protected:
|
||||
@ -998,24 +682,24 @@ class LIB_EXPORT JKQTPdatastoreItem {
|
||||
JKQTPdatastoreItem();
|
||||
public:
|
||||
/** \brief class constructor: initializes the object for internal data storage */
|
||||
JKQTPdatastoreItem(size_t columns, unsigned long long rows);
|
||||
JKQTPdatastoreItem(size_t columns, size_t rows);
|
||||
/** \brief class constructor: initializes the object for external data storage */
|
||||
JKQTPdatastoreItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, unsigned long long rows);
|
||||
JKQTPdatastoreItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, size_t rows);
|
||||
/** \brief class constructor: initializes the object for external data storage */
|
||||
JKQTPdatastoreItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, unsigned long long rows, bool internal);
|
||||
JKQTPdatastoreItem(JKQTPdatastoreItemFormat dataformat, double* data, size_t columns, size_t rows, bool internal);
|
||||
/** \brief class destructor: frees unfreed internal memory */
|
||||
virtual ~JKQTPdatastoreItem();
|
||||
|
||||
/** \brief change the size of all columns to the givne number of rows. The data will be lost */
|
||||
void resizeColumns(unsigned long long rows);
|
||||
void resizeColumns(size_t rows);
|
||||
|
||||
JKQTPGET_MACRO(unsigned long long, rows)
|
||||
JKQTPGET_MACRO(size_t, rows)
|
||||
JKQTPGET_MACRO(size_t, columns)
|
||||
|
||||
|
||||
/** \brief returns the data at the position (\a column, \a row ). The column index specifies the column inside THIS item, not the global column number. */
|
||||
inline double get(size_t column, unsigned long long row) {
|
||||
if (data!=NULL) switch(dataformat) {
|
||||
inline double get(size_t column, size_t row) {
|
||||
if (data!=nullptr) switch(dataformat) {
|
||||
case JKQTPsingleColumn:
|
||||
return data[row];
|
||||
case JKQTPmatrixColumn:
|
||||
@ -1028,8 +712,8 @@ class LIB_EXPORT JKQTPdatastoreItem {
|
||||
|
||||
|
||||
/** \brief returns the data at the position (\a column, \a row ). The column index specifies the column inside THIS item, not the global column number. */
|
||||
inline double* getPointer(size_t column, unsigned long long row) {
|
||||
if (data!=NULL) switch(dataformat) {
|
||||
inline double* getPointer(size_t column, size_t row) {
|
||||
if (data!=nullptr) switch(dataformat) {
|
||||
case JKQTPsingleColumn:
|
||||
return &(data[row]);
|
||||
case JKQTPmatrixColumn:
|
||||
@ -1037,11 +721,11 @@ class LIB_EXPORT JKQTPdatastoreItem {
|
||||
case JKQTPmatrixRow:
|
||||
return &(data[row*columns+column]);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
/** \brief set the data at the position (\a column, \a row ) to \a value. The column index specifies the column inside THIS item, not the global column number. */
|
||||
inline void set(size_t column, unsigned long long row, double value) {
|
||||
if (data!=NULL) switch(dataformat) {
|
||||
inline void set(size_t column, size_t row, double value) {
|
||||
if (data!=nullptr) switch(dataformat) {
|
||||
case JKQTPsingleColumn:
|
||||
data[row]=value;
|
||||
return;
|
||||
@ -1064,7 +748,7 @@ class LIB_EXPORT JKQTPdatastoreItem {
|
||||
class LIB_EXPORT JKQTPdatastoreModel: public QAbstractTableModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPdatastoreModel(JKQTPdatastore* datastore, QObject* parent=NULL);
|
||||
JKQTPdatastoreModel(JKQTPdatastore* datastore, QObject* parent=nullptr);
|
||||
~JKQTPdatastoreModel();
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -68,7 +68,7 @@ class LIB_EXPORT JKQTPgraph: public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
explicit JKQTPgraph(JKQtBasePlotter* parent=NULL);
|
||||
explicit JKQTPgraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
explicit JKQTPgraph(JKQtPlotter* parent);
|
||||
|
||||
@ -214,7 +214,7 @@ class LIB_EXPORT JKQTPxyGraph: public JKQTPgraph {
|
||||
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPxyGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPxyGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPxyGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -273,9 +273,9 @@ class LIB_EXPORT JKQTPsingleColumnGraph: public JKQTPgraph {
|
||||
Sorted=1
|
||||
};
|
||||
/** \brief class constructor */
|
||||
JKQTPsingleColumnGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPsingleColumnGraph(int dataColumn, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPsingleColumnGraph(int dataColumn, QColor color, Qt::PenStyle style=Qt::SolidLine, double lineWidth=2.0, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPsingleColumnGraph(JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPsingleColumnGraph(int dataColumn, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPsingleColumnGraph(int dataColumn, QColor color, Qt::PenStyle style=Qt::SolidLine, double lineWidth=2.0, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPsingleColumnGraph(JKQtPlotter* parent);
|
||||
JKQTPsingleColumnGraph(int dataColumn, JKQtPlotter* parent);
|
||||
JKQTPsingleColumnGraph(int dataColumn, QColor color, Qt::PenStyle style, double lineWidth, JKQtPlotter* parent);
|
||||
@ -339,9 +339,9 @@ class LIB_EXPORT JKQTPPeakStreamGraph: public JKQTPsingleColumnGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPPeakStreamGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPPeakStreamGraph(int dataColumn, double baseline, double peakHeight, QColor color, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPPeakStreamGraph(int dataColumn, double baseline, double peakHeight, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPPeakStreamGraph(JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPPeakStreamGraph(int dataColumn, double baseline, double peakHeight, QColor color, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPPeakStreamGraph(int dataColumn, double baseline, double peakHeight, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPPeakStreamGraph(JKQtPlotter* parent);
|
||||
JKQTPPeakStreamGraph(int dataColumn, double baseline, double peakHeight, QColor color, JKQtPlotter* parent);
|
||||
JKQTPPeakStreamGraph(int dataColumn, double baseline, double peakHeight, JKQtPlotter* parent);
|
||||
@ -429,11 +429,11 @@ class LIB_EXPORT JKQTPgraphErrors {
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. This method is called by
|
||||
* the JKQTPgraph descendents */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int>* dataorder=NULL)=0;
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int>* dataorder=nullptr)=0;
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
void intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPerrorPlotstyle xErrorStyle, JKQTPerrorPlotstyle yErrorStyle, long long datarange_start=-1, long long datarange_end=-1, int xErrorColumnLower=-1, int yErrorColumnLower=-1, bool xErrorSymmetric=true, bool yErrorSymmetric=true, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=NULL);
|
||||
void intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPerrorPlotstyle xErrorStyle, JKQTPerrorPlotstyle yErrorStyle, long long datarange_start=-1, long long datarange_end=-1, int xErrorColumnLower=-1, int yErrorColumnLower=-1, bool xErrorSymmetric=true, bool yErrorSymmetric=true, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr);
|
||||
|
||||
/** \brief this function can be used to set the color of the error indicators automatically
|
||||
*
|
||||
@ -493,7 +493,7 @@ class LIB_EXPORT JKQTPxGraphErrors: public JKQTPgraphErrors {
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=NULL);
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr);
|
||||
|
||||
virtual double getXErrorU(int i, JKQTPdatastore* ds) const;
|
||||
virtual double getXErrorL(int i, JKQTPdatastore* ds) const;
|
||||
@ -542,7 +542,7 @@ class LIB_EXPORT JKQTPyGraphErrors: public JKQTPgraphErrors {
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=NULL);
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr);
|
||||
|
||||
virtual double getYErrorU(int i, JKQTPdatastore* ds) const;
|
||||
virtual double getYErrorL(int i, JKQTPdatastore* ds) const;
|
||||
@ -614,7 +614,7 @@ class LIB_EXPORT JKQTPxyGraphErrors: public JKQTPgraphErrors {
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=NULL);
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQtBasePlotter* parent, JKQTPcoordinateAxis* xAxis, JKQTPcoordinateAxis* yAxis, int xColumn, int yColumn, long long datarange_start=-1, long long datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr);
|
||||
|
||||
virtual double getXErrorU(int i, JKQTPdatastore* ds) const;
|
||||
virtual double getXErrorL(int i, JKQTPdatastore* ds) const;
|
||||
@ -635,7 +635,7 @@ class LIB_EXPORT JKQTPxyLineGraph: public JKQTPxyGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPxyLineGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPxyLineGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPxyLineGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -709,7 +709,7 @@ class LIB_EXPORT JKQTPxyParametrizedScatterGraph: public JKQTPxyLineGraph, publi
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPxyParametrizedScatterGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPxyParametrizedScatterGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPxyParametrizedScatterGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -800,7 +800,7 @@ class LIB_EXPORT JKQTPxyLineErrorGraph: public JKQTPxyLineGraph, public JKQTPxyG
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPxyLineErrorGraph(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPxyLineErrorGraph(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPxyLineGraph(parent), JKQTPxyGraphErrors()
|
||||
{ setErrorColorFromGraphColor(color); }
|
||||
/** \brief class constructor */
|
||||
@ -840,7 +840,7 @@ class LIB_EXPORT JKQTPxyLineErrorGraph: public JKQTPxyLineGraph, public JKQTPxyG
|
||||
class LIB_EXPORT JKQTPxyParametrizedErrorScatterGraph: public JKQTPxyParametrizedScatterGraph, public JKQTPxyGraphErrors {
|
||||
Q_OBJECT
|
||||
public:
|
||||
inline JKQTPxyParametrizedErrorScatterGraph(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPxyParametrizedErrorScatterGraph(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPxyParametrizedScatterGraph(parent), JKQTPxyGraphErrors()
|
||||
{ setErrorColorFromGraphColor(color); }
|
||||
inline JKQTPxyParametrizedErrorScatterGraph(JKQtPlotter* parent):
|
||||
@ -886,7 +886,7 @@ class LIB_EXPORT JKQTPimpulsesHorizontalGraph: public JKQTPxyGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPimpulsesHorizontalGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPimpulsesHorizontalGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPimpulsesHorizontalGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -927,7 +927,7 @@ class LIB_EXPORT JKQTPimpulsesHorizontalErrorGraph: public JKQTPimpulsesHorizont
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPimpulsesHorizontalErrorGraph(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPimpulsesHorizontalErrorGraph(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPimpulsesHorizontalGraph(parent), JKQTPxGraphErrors()
|
||||
{
|
||||
setErrorColorFromGraphColor(color);
|
||||
@ -963,7 +963,7 @@ class LIB_EXPORT JKQTPimpulsesVerticalGraph: public JKQTPimpulsesHorizontalGraph
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPimpulsesVerticalGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPimpulsesVerticalGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPimpulsesVerticalGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -982,7 +982,7 @@ class LIB_EXPORT JKQTPimpulsesVerticalErrorGraph: public JKQTPimpulsesVerticalGr
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPimpulsesVerticalErrorGraph(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPimpulsesVerticalErrorGraph(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPimpulsesVerticalGraph(parent), JKQTPyGraphErrors()
|
||||
{
|
||||
setErrorColorFromGraphColor(color);
|
||||
@ -1022,7 +1022,7 @@ class LIB_EXPORT JKQTPfilledCurveXGraph: public JKQTPxyGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPfilledCurveXGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPfilledCurveXGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPfilledCurveXGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -1084,7 +1084,7 @@ class LIB_EXPORT JKQTPfilledCurveXErrorGraph: public JKQTPfilledCurveXGraph, pub
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPfilledCurveXErrorGraph(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPfilledCurveXErrorGraph(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPfilledCurveXGraph(parent), JKQTPyGraphErrors()
|
||||
{
|
||||
setErrorColorFromGraphColor(color);
|
||||
@ -1123,7 +1123,7 @@ class LIB_EXPORT JKQTPfilledCurveYGraph: public JKQTPfilledCurveXGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPfilledCurveYGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPfilledCurveYGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPfilledCurveYGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -1142,7 +1142,7 @@ class LIB_EXPORT JKQTPfilledCurveYErrorGraph: public JKQTPfilledCurveYGraph, pub
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPfilledCurveYErrorGraph(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPfilledCurveYErrorGraph(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPfilledCurveYGraph(parent), JKQTPxGraphErrors()
|
||||
{
|
||||
setErrorColorFromGraphColor(color);
|
||||
@ -1189,7 +1189,7 @@ class LIB_EXPORT JKQTPboxplotVerticalGraph: public JKQTPgraph {
|
||||
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPboxplotVerticalGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPboxplotVerticalGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPboxplotVerticalGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -1304,7 +1304,7 @@ class LIB_EXPORT JKQTPboxplotHorizontalGraph: public JKQTPboxplotVerticalGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPboxplotHorizontalGraph(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPboxplotHorizontalGraph(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPboxplotVerticalGraph(parent)
|
||||
{
|
||||
}
|
||||
@ -1351,7 +1351,7 @@ class LIB_EXPORT JKQTPboxplotVerticalElement: public JKQTPgraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPboxplotVerticalElement(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPboxplotVerticalElement(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPboxplotVerticalElement(JKQtPlotter* parent);
|
||||
|
||||
@ -1456,7 +1456,7 @@ class LIB_EXPORT JKQTPboxplotHorizontalElement: public JKQTPboxplotVerticalEleme
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPboxplotHorizontalElement(JKQtBasePlotter* parent=NULL):
|
||||
inline JKQTPboxplotHorizontalElement(JKQtBasePlotter* parent=nullptr):
|
||||
JKQTPboxplotVerticalElement(parent)
|
||||
{
|
||||
}
|
||||
@ -1526,7 +1526,7 @@ class LIB_EXPORT JKQTPxFunctionLineGraph: public JKQTPgraph {
|
||||
};
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPxFunctionLineGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPxFunctionLineGraph(JKQtBasePlotter* parent=nullptr);
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPxFunctionLineGraph(JKQtPlotter* parent);
|
||||
@ -1716,7 +1716,7 @@ class LIB_EXPORT JKQTPyFunctionLineGraph: public JKQTPxFunctionLineGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPyFunctionLineGraph(JKQtBasePlotter* parent=NULL):JKQTPxFunctionLineGraph(parent) {}
|
||||
inline JKQTPyFunctionLineGraph(JKQtBasePlotter* parent=nullptr):JKQTPxFunctionLineGraph(parent) {}
|
||||
/** \brief class constructor */
|
||||
inline JKQTPyFunctionLineGraph(JKQtPlotter* parent):JKQTPxFunctionLineGraph(parent) {}
|
||||
|
||||
@ -1758,7 +1758,7 @@ class LIB_EXPORT JKQTPstepHorizontalGraph: public JKQTPxyGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPstepHorizontalGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPstepHorizontalGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPstepHorizontalGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -1827,7 +1827,7 @@ class LIB_EXPORT JKQTPstepVerticalGraph: public JKQTPstepHorizontalGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPstepVerticalGraph(JKQtBasePlotter* parent=NULL): JKQTPstepHorizontalGraph(parent) {}
|
||||
inline JKQTPstepVerticalGraph(JKQtBasePlotter* parent=nullptr): JKQTPstepHorizontalGraph(parent) {}
|
||||
/** \brief class constructor */
|
||||
inline JKQTPstepVerticalGraph(JKQtPlotter* parent): JKQTPstepHorizontalGraph(parent) {}
|
||||
|
||||
@ -1871,7 +1871,7 @@ class LIB_EXPORT JKQTPbarHorizontalGraph: public JKQTPxyGraph, public JKQTPxyGra
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPbarHorizontalGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPbarHorizontalGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPbarHorizontalGraph(JKQtPlotter* parent);
|
||||
|
||||
@ -1975,7 +1975,7 @@ class LIB_EXPORT JKQTPbarVerticalGraph: public JKQTPbarHorizontalGraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
inline JKQTPbarVerticalGraph(JKQtBasePlotter* parent=NULL): JKQTPbarHorizontalGraph(parent) {}
|
||||
inline JKQTPbarVerticalGraph(JKQtBasePlotter* parent=nullptr): JKQTPbarHorizontalGraph(parent) {}
|
||||
/** \brief class constructor */
|
||||
inline JKQTPbarVerticalGraph(JKQtPlotter* parent): JKQTPbarHorizontalGraph(parent) {}
|
||||
|
||||
@ -2022,7 +2022,7 @@ class LIB_EXPORT JKQTPhorizontalRange: public JKQTPgraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPhorizontalRange(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPhorizontalRange(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPhorizontalRange(JKQtPlotter* parent);
|
||||
|
||||
@ -2133,7 +2133,7 @@ class LIB_EXPORT JKQTPverticalRange: public JKQTPhorizontalRange {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPverticalRange(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPverticalRange(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPverticalRange(JKQtPlotter* parent);
|
||||
|
||||
|
@ -56,7 +56,7 @@ class LIB_EXPORT JKQTPgeoBaseLine: public JKQTPgraph {
|
||||
\param style line style of drawing
|
||||
\param lineWidth lineWidth of drawing
|
||||
*/
|
||||
explicit JKQTPgeoBaseLine(QColor color, double lineWidth, Qt::PenStyle style=Qt::SolidLine, JKQtBasePlotter* parent=NULL);
|
||||
explicit JKQTPgeoBaseLine(QColor color, double lineWidth, Qt::PenStyle style=Qt::SolidLine, JKQtBasePlotter* parent=nullptr);
|
||||
/*! \brief class contructor
|
||||
|
||||
\param color color of drawing
|
||||
@ -104,7 +104,7 @@ class LIB_EXPORT JKQTPgeoBaseFilled: public JKQTPgeoBaseLine {
|
||||
\param fillStyle filling style of the graph
|
||||
\param lineWidth lineWidth of drawing
|
||||
*/
|
||||
JKQTPgeoBaseFilled(QColor color, QColor fillColor, double lineWidth, Qt::PenStyle style=Qt::SolidLine, Qt::BrushStyle fillStyle=Qt::SolidPattern, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPgeoBaseFilled(QColor color, QColor fillColor, double lineWidth, Qt::PenStyle style=Qt::SolidLine, Qt::BrushStyle fillStyle=Qt::SolidPattern, JKQtBasePlotter* parent=nullptr);
|
||||
/*! \brief class contructor
|
||||
|
||||
\param color color of drawing
|
||||
|
@ -157,7 +157,7 @@ void JKQTPImageBase::plotImage(JKQTPEnhancedPainter& painter, QImage& image, dou
|
||||
JKQTPImage::JKQTPImage(JKQtBasePlotter *parent):
|
||||
JKQTPImageBase(parent)
|
||||
{
|
||||
this->image=NULL;
|
||||
this->image=nullptr;
|
||||
createImageActions();
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ JKQTPImage::JKQTPImage(double x, double y, double width, double height, QImage*
|
||||
JKQTPImage::JKQTPImage(JKQtPlotter *parent):
|
||||
JKQTPImageBase(parent)
|
||||
{
|
||||
this->image=NULL;
|
||||
this->image=nullptr;
|
||||
createImageActions();
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ void JKQTPImage::saveImagePlotAsImage(const QString &filename, const QByteArray
|
||||
QString selFormat;
|
||||
if (fn.isEmpty()) {
|
||||
selFormat=currentFileFormat;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Image Plot As Image ..."),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Image Plot As Image ..."),
|
||||
currentSaveDirectory,
|
||||
filt.join(";;"), &selFormat);
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -287,7 +287,7 @@ JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double
|
||||
this->datatype=datatype;
|
||||
this->Nx=Nx;
|
||||
this->Ny=Ny;
|
||||
dataModifier=NULL;
|
||||
dataModifier=nullptr;
|
||||
datatypeModifier=DoubleArray;
|
||||
modifierMode=ModifyNone;
|
||||
}
|
||||
@ -300,7 +300,7 @@ JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double
|
||||
this->datatype=datatype;
|
||||
this->Nx=Nx;
|
||||
this->Ny=Ny;
|
||||
dataModifier=NULL;
|
||||
dataModifier=nullptr;
|
||||
datatypeModifier=DoubleArray;
|
||||
modifierMode=ModifyNone;
|
||||
}
|
||||
@ -312,11 +312,11 @@ void JKQTPMathImageBase::drawKeyMarker(JKQTPEnhancedPainter &/*painter*/, QRectF
|
||||
JKQTPMathImageBase::JKQTPMathImageBase(JKQtBasePlotter *parent):
|
||||
JKQTPImageBase(parent)
|
||||
{
|
||||
this->data=NULL;
|
||||
this->data=nullptr;
|
||||
this->Nx=0;
|
||||
this->Ny=0;
|
||||
this->datatype=DoubleArray;
|
||||
dataModifier=NULL;
|
||||
dataModifier=nullptr;
|
||||
datatypeModifier=DoubleArray;
|
||||
modifierMode=ModifyNone;
|
||||
}
|
||||
@ -324,11 +324,11 @@ JKQTPMathImageBase::JKQTPMathImageBase(JKQtBasePlotter *parent):
|
||||
JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double height, JKQtBasePlotter *parent):
|
||||
JKQTPImageBase(x,y,width,height,parent)
|
||||
{
|
||||
this->data=NULL;
|
||||
this->data=nullptr;
|
||||
this->Nx=0;
|
||||
this->Ny=0;
|
||||
this->datatype=DoubleArray;
|
||||
dataModifier=NULL;
|
||||
dataModifier=nullptr;
|
||||
datatypeModifier=DoubleArray;
|
||||
modifierMode=ModifyNone;
|
||||
}
|
||||
@ -336,11 +336,11 @@ JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double
|
||||
JKQTPMathImageBase::JKQTPMathImageBase(JKQtPlotter *parent):
|
||||
JKQTPImageBase(parent)
|
||||
{
|
||||
this->data=NULL;
|
||||
this->data=nullptr;
|
||||
this->Nx=0;
|
||||
this->Ny=0;
|
||||
this->datatype=DoubleArray;
|
||||
dataModifier=NULL;
|
||||
dataModifier=nullptr;
|
||||
datatypeModifier=DoubleArray;
|
||||
modifierMode=ModifyNone;
|
||||
}
|
||||
@ -348,11 +348,11 @@ JKQTPMathImageBase::JKQTPMathImageBase(JKQtPlotter *parent):
|
||||
JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double height, JKQtPlotter *parent):
|
||||
JKQTPImageBase(x,y,width,height,parent)
|
||||
{
|
||||
this->data=NULL;
|
||||
this->data=nullptr;
|
||||
this->Nx=0;
|
||||
this->Ny=0;
|
||||
this->datatype=DoubleArray;
|
||||
dataModifier=NULL;
|
||||
dataModifier=nullptr;
|
||||
datatypeModifier=DoubleArray;
|
||||
modifierMode=ModifyNone;
|
||||
}
|
||||
@ -682,7 +682,7 @@ JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height,
|
||||
}
|
||||
|
||||
JKQTPMathImage::JKQTPMathImage(JKQtBasePlotter *parent):
|
||||
JKQTPMathImageBase(0, 0, 1, 1, JKQTPMathImageBase::UInt8Array, NULL, 0, 0, parent)
|
||||
JKQTPMathImageBase(0, 0, 1, 1, JKQTPMathImageBase::UInt8Array, nullptr, 0, 0, parent)
|
||||
{
|
||||
initJKQTPMathImage();
|
||||
}
|
||||
@ -697,7 +697,7 @@ JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height,
|
||||
}
|
||||
|
||||
JKQTPMathImage::JKQTPMathImage(JKQtPlotter *parent):
|
||||
JKQTPMathImageBase(0, 0, 1, 1, JKQTPMathImageBase::UInt8Array, NULL, 0, 0, parent)
|
||||
JKQTPMathImageBase(0, 0, 1, 1, JKQTPMathImageBase::UInt8Array, nullptr, 0, 0, parent)
|
||||
{
|
||||
initJKQTPMathImage();
|
||||
}
|
||||
@ -750,7 +750,7 @@ void JKQTPMathImage::saveImagePlotAsImage(const QString &filename, const QByteAr
|
||||
QString selFormat;
|
||||
if (fn.isEmpty()) {
|
||||
selFormat=currentFileFormat;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Image Plot As Image ..."),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Image Plot As Image ..."),
|
||||
currentSaveDirectory,
|
||||
filt.join(";;"), &selFormat);
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -800,7 +800,7 @@ void JKQTPMathImage::saveColorbarPlotAsImage(const QString &filename, const QByt
|
||||
QString selFormat;
|
||||
if (fn.isEmpty()) {
|
||||
selFormat=currentFileFormat;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Image Plot As Image ..."),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Image Plot As Image ..."),
|
||||
currentSaveDirectory,
|
||||
filt.join(";;"), &selFormat);
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -1242,7 +1242,7 @@ JKQTPOverlayImage::JKQTPOverlayImage(JKQtBasePlotter *parent):
|
||||
connect(actCopyImage, SIGNAL(triggered()), this, SLOT(copyImagePlotAsImage()));
|
||||
this->Nx=0;
|
||||
this->Ny=0;
|
||||
this->data=NULL;
|
||||
this->data=nullptr;
|
||||
this->trueColor=QColor("red");
|
||||
}
|
||||
|
||||
@ -1269,7 +1269,7 @@ JKQTPOverlayImage::JKQTPOverlayImage(JKQtPlotter *parent):
|
||||
connect(actCopyImage, SIGNAL(triggered()), this, SLOT(copyImagePlotAsImage()));
|
||||
this->Nx=0;
|
||||
this->Ny=0;
|
||||
this->data=NULL;
|
||||
this->data=nullptr;
|
||||
this->trueColor=QColor("red");
|
||||
}
|
||||
|
||||
@ -1341,7 +1341,7 @@ JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(double x, double y, double
|
||||
}
|
||||
|
||||
JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(JKQtBasePlotter *parent):
|
||||
JKQTPOverlayImage(0,0,1,1,NULL,0,0, QColor("red"), parent)
|
||||
JKQTPOverlayImage(0,0,1,1,nullptr,0,0, QColor("red"), parent)
|
||||
{
|
||||
symbol=JKQTPtarget;
|
||||
symbolWidth=1;
|
||||
@ -1361,7 +1361,7 @@ JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(double x, double y, double
|
||||
}
|
||||
|
||||
JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(JKQtPlotter *parent):
|
||||
JKQTPOverlayImage(0,0,1,1,NULL,0,0, QColor("red"), parent)
|
||||
JKQTPOverlayImage(0,0,1,1,nullptr,0,0, QColor("red"), parent)
|
||||
{
|
||||
symbol=JKQTPtarget;
|
||||
symbolWidth=1;
|
||||
@ -1541,14 +1541,14 @@ JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double he
|
||||
}
|
||||
|
||||
JKQTPRGBMathImage::JKQTPRGBMathImage(JKQtBasePlotter *parent):
|
||||
JKQTPMathImageBase(0,0,0,0, DoubleArray, NULL, 0, 0, parent)
|
||||
JKQTPMathImageBase(0,0,0,0, DoubleArray, nullptr, 0, 0, parent)
|
||||
{
|
||||
initObject();
|
||||
}
|
||||
|
||||
|
||||
JKQTPRGBMathImage::JKQTPRGBMathImage(JKQtPlotter *parent):
|
||||
JKQTPMathImageBase(0,0,0,0, DoubleArray, NULL, 0, 0, parent)
|
||||
JKQTPMathImageBase(0,0,0,0, DoubleArray, nullptr, 0, 0, parent)
|
||||
{
|
||||
initObject();
|
||||
}
|
||||
@ -2089,7 +2089,7 @@ void JKQTPRGBMathImage::saveImagePlotAsImage(const QString &filename, const QByt
|
||||
QString selFormat;
|
||||
if (fn.isEmpty()) {
|
||||
selFormat=currentFileFormat;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Image Plot As Image ..."),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Image Plot As Image ..."),
|
||||
currentSaveDirectory,
|
||||
filt.join(";;"), &selFormat);
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
@ -2199,8 +2199,8 @@ QImage JKQTPRGBMathImage::drawImage() {
|
||||
void JKQTPRGBMathImage::set_data(void* data, uint32_t Nx, uint32_t Ny, DataType datatype) {
|
||||
this->data=data;
|
||||
this->datatype=datatype;
|
||||
this->dataG=NULL;
|
||||
this->dataB=NULL;
|
||||
this->dataG=nullptr;
|
||||
this->dataB=nullptr;
|
||||
this->Nx=Nx;
|
||||
this->Ny=Ny;
|
||||
}
|
||||
@ -2209,8 +2209,8 @@ void JKQTPRGBMathImage::set_data(void* data, uint32_t Nx, uint32_t Ny) {
|
||||
this->data=data;
|
||||
this->Nx=Nx;
|
||||
this->Ny=Ny;
|
||||
this->dataG=NULL;
|
||||
this->dataB=NULL;
|
||||
this->dataG=nullptr;
|
||||
this->dataB=nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -2244,7 +2244,7 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(JKQtBasePlotter *parent):
|
||||
}
|
||||
|
||||
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtBasePlotter *parent):
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,NULL,Nx,Ny,JKQTPMathImageGRAY,parent)
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageColumn=-1;
|
||||
@ -2252,7 +2252,7 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, dou
|
||||
}
|
||||
|
||||
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQtBasePlotter *parent):
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,NULL,Nx,Ny,palette,parent)
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,palette,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageColumn=imageColumn;
|
||||
@ -2268,7 +2268,7 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(JKQtPlotter *parent):
|
||||
}
|
||||
|
||||
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtPlotter *parent):
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,NULL,Nx,Ny,JKQTPMathImageGRAY,parent)
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageColumn=-1;
|
||||
@ -2276,14 +2276,14 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, dou
|
||||
}
|
||||
|
||||
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQtPlotter *parent):
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,NULL,Nx,Ny,palette,parent)
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,palette,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageColumn=imageColumn;
|
||||
this->datatype=JKQTPMathImageBase::DoubleArray;
|
||||
}
|
||||
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQtPlotter *parent):
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,NULL,Nx,Ny,JKQTPMathImageGRAY,parent)
|
||||
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageColumn=imageColumn;
|
||||
@ -2300,7 +2300,7 @@ void JKQTPColumnMathImage::ensureImageData()
|
||||
|
||||
if (this->Nx==0 || imageColumn<0 || !parent->getDatastore()->getColumn(imageColumn).getPointer(0)) {
|
||||
this->Ny=0;
|
||||
this->data=NULL;
|
||||
this->data=nullptr;
|
||||
this->datatype=JKQTPMathImageBase::DoubleArray;
|
||||
} else {
|
||||
this->datatype=JKQTPMathImageBase::DoubleArray;
|
||||
@ -2308,7 +2308,7 @@ void JKQTPColumnMathImage::ensureImageData()
|
||||
this->Ny=parent->getDatastore()->getColumn(imageColumn).getRows()/this->Nx;
|
||||
}
|
||||
if (this->Nx==0 || modifierColumn<0 || !parent->getDatastore()->getColumn(modifierColumn).getPointer(0)) {
|
||||
this->dataModifier=NULL;
|
||||
this->dataModifier=nullptr;
|
||||
} else {
|
||||
this->datatypeModifier=JKQTPMathImageBase::DoubleArray;
|
||||
this->dataModifier=parent->getDatastore()->getColumn(modifierColumn).getPointer(0);
|
||||
@ -2336,7 +2336,7 @@ void JKQTPColumnOverlayImageEnhanced::draw(JKQTPEnhancedPainter &painter) {
|
||||
}
|
||||
JKQTPOverlayImageEnhanced::draw(painter);
|
||||
free(data);
|
||||
data=NULL;
|
||||
data=nullptr;
|
||||
}
|
||||
|
||||
bool JKQTPColumnOverlayImageEnhanced::usesColumn(int c)
|
||||
@ -2345,7 +2345,7 @@ bool JKQTPColumnOverlayImageEnhanced::usesColumn(int c)
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(JKQtBasePlotter *parent):
|
||||
JKQTPRGBMathImage(0,0,0,0,DoubleArray,NULL,0,0,parent)
|
||||
JKQTPRGBMathImage(0,0,0,0,DoubleArray,nullptr,0,0,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=-1;
|
||||
@ -2355,7 +2355,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(JKQtBasePlotter *parent):
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtBasePlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=-1;
|
||||
@ -2365,7 +2365,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=imageRColumn;
|
||||
@ -2375,7 +2375,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=imageRColumn;
|
||||
@ -2385,7 +2385,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=imageRColumn;
|
||||
@ -2395,7 +2395,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(JKQtPlotter *parent):
|
||||
JKQTPRGBMathImage(0,0,0,0,DoubleArray,NULL,0,0,parent)
|
||||
JKQTPRGBMathImage(0,0,0,0,DoubleArray,nullptr,0,0,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=-1;
|
||||
@ -2405,7 +2405,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(JKQtPlotter *parent):
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtPlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=-1;
|
||||
@ -2415,7 +2415,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQtPlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=imageRColumn;
|
||||
@ -2425,7 +2425,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQtPlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=imageRColumn;
|
||||
@ -2435,7 +2435,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
|
||||
}
|
||||
|
||||
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQtPlotter *parent):
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,NULL,Nx,Ny,parent)
|
||||
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
|
||||
{
|
||||
this->modifierColumn=-1;
|
||||
this->imageRColumn=imageRColumn;
|
||||
@ -2619,7 +2619,7 @@ void JKQTPOverlayImage::saveImagePlotAsImage(const QString &filename, const QByt
|
||||
QString selFormat;
|
||||
if (fn.isEmpty()) {
|
||||
selFormat=currentFileFormat;
|
||||
fn = QFileDialog::getSaveFileName(NULL, tr("Save Image Plot As Image ..."),
|
||||
fn = QFileDialog::getSaveFileName(nullptr, tr("Save Image Plot As Image ..."),
|
||||
currentSaveDirectory,
|
||||
filt.join(";;"), &selFormat);
|
||||
if (!fn.isEmpty()) currentSaveDirectory=QFileInfo(fn).absolutePath();
|
||||
|
@ -54,9 +54,9 @@ class LIB_EXPORT JKQTPImageBase: public JKQTPgraph {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPImageBase(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPImageBase(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPImageBase(double x, double y, double width, double height, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPImageBase(double x, double y, double width, double height, JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPImageBase(JKQtPlotter* parent);
|
||||
/** \brief class constructor */
|
||||
@ -151,14 +151,14 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
|
||||
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPMathImageBase(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPMathImageBase(double x, double y, double width, double height, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPMathImageBase(JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPMathImageBase(double x, double y, double width, double height, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=nullptr);
|
||||
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPMathImageBase(JKQtPlotter* parent);
|
||||
JKQTPMathImageBase(double x, double y, double width, double height, JKQtPlotter* parent=NULL);
|
||||
JKQTPMathImageBase(double x, double y, double width, double height, JKQtPlotter* parent=nullptr);
|
||||
JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQtPlotter* parent);
|
||||
|
||||
/** \brief plots a key marker inside the specified rectangle \a rect */
|
||||
@ -220,7 +220,7 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
|
||||
class LIB_EXPORT JKQTPImageModifierModeComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPImageModifierModeComboBox(QWidget* parent=NULL);
|
||||
JKQTPImageModifierModeComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPMathImageBase::ModifierMode getModifierMode() const;
|
||||
void setModifierMode(JKQTPMathImageBase::ModifierMode mode);
|
||||
@ -237,11 +237,11 @@ class LIB_EXPORT JKQTPImage: public JKQTPImageBase {
|
||||
public:
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPImage(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPImage(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPImage(JKQtPlotter* parent);
|
||||
/** \brief class constructor */
|
||||
JKQTPImage(double x, double y, double width, double height, QImage* image, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPImage(double x, double y, double width, double height, QImage* image, JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPImage(double x, double y, double width, double height, QImage* image, JKQtPlotter* parent);
|
||||
|
||||
@ -284,8 +284,8 @@ class LIB_EXPORT JKQTPMathImage: public JKQTPMathImageBase {
|
||||
public:
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPMathImage(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPMathImage(JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQtPlotter* parent);
|
||||
JKQTPMathImage(JKQtPlotter* parent);
|
||||
|
||||
@ -470,13 +470,13 @@ class LIB_EXPORT JKQTPRGBMathImage: public JKQTPMathImageBase {
|
||||
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=nullptr);
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQtPlotter* parent);
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPRGBMathImage(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPRGBMathImage(JKQtBasePlotter* parent=nullptr);
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPRGBMathImage(JKQtPlotter* parent);
|
||||
@ -655,9 +655,9 @@ class LIB_EXPORT JKQTPColumnMathImage: public JKQTPMathImage {
|
||||
public:
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPColumnMathImage(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnMathImage(JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPColumnMathImage(JKQtPlotter* parent);
|
||||
JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtPlotter* parent);
|
||||
@ -691,11 +691,11 @@ class LIB_EXPORT JKQTPColumnRGBMathImage: public JKQTPRGBMathImage {
|
||||
public:
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPColumnRGBMathImage(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnRGBMathImage(JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPColumnRGBMathImage(JKQtPlotter* parent);
|
||||
JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQtPlotter* parent);
|
||||
@ -733,8 +733,8 @@ class LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase {
|
||||
public:
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPOverlayImage(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPOverlayImage(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPOverlayImage(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPOverlayImage(JKQtBasePlotter* parent=nullptr);
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPOverlayImage(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQtPlotter* parent);
|
||||
@ -799,8 +799,8 @@ class LIB_EXPORT JKQTPOverlayImageEnhanced: public JKQTPOverlayImage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPOverlayImageEnhanced(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPOverlayImageEnhanced(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQtPlotter* parent);
|
||||
JKQTPOverlayImageEnhanced(JKQtPlotter* parent);
|
||||
@ -846,7 +846,7 @@ class LIB_EXPORT JKQTPOverlayImageEnhanced: public JKQTPOverlayImage {
|
||||
class LIB_EXPORT JKQTPColumnOverlayImageEnhanced: public JKQTPOverlayImageEnhanced {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPColumnOverlayImageEnhanced(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPColumnOverlayImageEnhanced(JKQtBasePlotter* parent=nullptr);
|
||||
JKQTPColumnOverlayImageEnhanced(JKQtPlotter* parent);
|
||||
|
||||
JKQTPGET_SET_MACRO(int, imageColumn)
|
||||
@ -884,9 +884,9 @@ class LIB_EXPORT JKQTPContour: public JKQTPMathImage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
JKQTPContour(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPContour(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPContour(double x, double y, double width, double height, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, DataType datatype = JKQTPMathImageBase::DoubleArray, JKQtBasePlotter* parent=NULL);
|
||||
JKQTPContour(double x, double y, double width, double height, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, DataType datatype = JKQTPMathImageBase::DoubleArray, JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPContour(JKQtPlotter* parent);
|
||||
/** \brief class constructor */
|
||||
|
@ -371,15 +371,15 @@ void JKQTPimagePlot_freeLUTs(QList<int *> &lutstore) {
|
||||
}
|
||||
|
||||
int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalette palette) {
|
||||
int* lut_used=NULL;
|
||||
int* lut_used=nullptr;
|
||||
|
||||
if (palette == JKQTPMathImageRED)
|
||||
{
|
||||
//int*& plut=lutstore[palette];
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgb(static_cast<int>(255.0*v), 0, 0);
|
||||
@ -393,10 +393,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageGREEN)
|
||||
{
|
||||
//int*& plut=&lut_green;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgb(0, static_cast<int>(255.0*v), 0);
|
||||
@ -410,10 +410,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageBLUE)
|
||||
{
|
||||
//int*& plut=&lut_blue;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgb(0, 0, static_cast<int>(255.0*v));
|
||||
@ -427,10 +427,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageGRAY)
|
||||
{
|
||||
//int*& plut=&lut_gray;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgb(static_cast<int>(255.0*v),
|
||||
@ -445,10 +445,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageALPHA)
|
||||
{
|
||||
//int*& plut=&lut_gray;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgba(255,255,255,
|
||||
@ -462,10 +462,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_ALPHA)
|
||||
{
|
||||
//int*& plut=&lut_gray;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgba(255,255,255,
|
||||
@ -479,10 +479,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTEDRED)
|
||||
{
|
||||
//int*& plut=&lut_invred;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgb(static_cast<int>(255.0*(1.0-v)), 0, 0);
|
||||
@ -496,10 +496,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTEDGREEN)
|
||||
{
|
||||
//int*& plut=&lut_invgreen;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgb(0, static_cast<int>(255.0*(1.0-v)), 0);
|
||||
@ -512,10 +512,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTEDBLUE)
|
||||
{
|
||||
//int*& plut=&lut_invblue;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=qRgb(0, 0, static_cast<int>(255.0*(1.0-v)));
|
||||
@ -528,10 +528,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTEDGRAY)
|
||||
{
|
||||
//int*& plut=&lut_invgray;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=1.0-(l/(double)(JKQTPimagePlot_LUTSIZE));
|
||||
plut[l]=qRgb(static_cast<int>(255.0*v),
|
||||
@ -547,10 +547,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageMATLAB)
|
||||
{
|
||||
//int*& plut=&lut_matlab;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 382.5 - 1020.0 * std::abs(v - 0.75);
|
||||
@ -581,10 +581,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_MATLAB)
|
||||
{
|
||||
//int*& plut=&lut_matlab_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=JKQTPimagePlot_LUTSIZE; l>=0; l--) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 382.5 - 1020.0 * std::abs(v - 0.75);
|
||||
@ -615,10 +615,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageRYGB) //gnuplot: 30,-13,-23
|
||||
{
|
||||
//int*& plut=&lut_rygb;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 796.875*v - 199.21875;
|
||||
@ -642,10 +642,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_RYGB) //gnuplot: 30,-13,-23
|
||||
{
|
||||
//int*& plut=&lut_rygb_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=JKQTPimagePlot_LUTSIZE; l>=0; l--) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 796.875*v - 199.21875;
|
||||
@ -669,10 +669,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageHSV)
|
||||
{
|
||||
//int*& plut=&lut_hsv;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
int h = static_cast<int>(floor(6*v));
|
||||
@ -696,10 +696,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_HSV)
|
||||
{
|
||||
//int*& plut=&lut_invhsv;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
int h = static_cast<int>(floor(6.0-6.0*v));
|
||||
@ -723,11 +723,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
}
|
||||
else if (palette == JKQTPMathImageRAINBOW) //gnuplot: 33,13,10
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 255.0*std::abs(2.0*v-0.5);
|
||||
@ -745,11 +745,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageINVERTED_RAINBOW) //gnuplot: 33,13,10
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=JKQTPimagePlot_LUTSIZE; l>=0; l--) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 255.0*std::abs(2.0*v-0.5);
|
||||
@ -769,10 +769,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageHOT) //gnuplot: 21,22,23
|
||||
{
|
||||
//int*& plut=&lut_hot;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 765.0*v;
|
||||
@ -797,10 +797,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_HOT) //gnuplot: 21,22,23
|
||||
{
|
||||
//int*& plut=&lut_hot_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=JKQTPimagePlot_LUTSIZE; l>=0; l--) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 765.0*v;
|
||||
@ -825,10 +825,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageOCEAN) //gnuplot: 23,28,3
|
||||
{
|
||||
//int*& plut=&lut_ocean;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 765.0*v-510.0;
|
||||
@ -847,10 +847,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_OCEAN) //gnuplot: 23,28,3
|
||||
{
|
||||
//int*& plut=&lut_ocean_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=JKQTPimagePlot_LUTSIZE; l>=0; l--) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 765.0*v-510.0;
|
||||
@ -868,10 +868,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
} else if (palette == JKQTPMathImageBLUEMAGENTAYELLOW) //gnuplot: 30,31,32
|
||||
{
|
||||
//int*& plut=&lut_bluemagentayellow;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = (v/0.32-0.78125);
|
||||
@ -898,10 +898,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_BLUEMAGENTAYELLOW) //gnuplot: 30,31,32
|
||||
{
|
||||
//int*& plut=&lut_bluemagentayellow_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = (v/0.32-0.78125);
|
||||
@ -928,10 +928,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageBLUEYELLOW) //gnuplot: 8,9,10
|
||||
{
|
||||
//int*& plut=&lut_blueyellow;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = sqrt(sqrt(v));
|
||||
@ -955,10 +955,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
} else if (palette == JKQTPMathImageINVERTED_BLUEYELLOW) //gnuplot: 8,9,10
|
||||
{
|
||||
//int*& plut=&lut_blueyellow_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = sqrt(sqrt(v));
|
||||
@ -982,10 +982,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
} else if (palette == JKQTPMathImageCYAN)
|
||||
{
|
||||
//int*& plut=&lut_cyan;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = v*0.5;
|
||||
@ -1009,10 +1009,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_CYAN)
|
||||
{
|
||||
//int*& plut=&lut_cyan_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = v*0.5;
|
||||
@ -1036,10 +1036,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageTRAFFICLIGHT)
|
||||
{
|
||||
//int*& plut=&lut_trafficlight;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=l/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = (v < 0.5) ? 128.0*sin(M_PI*(2.0*v-0.5))+128.0 : 255.0;
|
||||
@ -1059,10 +1059,10 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
else if (palette == JKQTPMathImageINVERTED_TRAFFICLIGHT)
|
||||
{
|
||||
//int*& plut=&lut_trafficlight_inverted;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = (v < 0.5) ? 128.0*sin(M_PI*(2.0*v-0.5))+128.0 : 255.0;
|
||||
@ -1081,11 +1081,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
}
|
||||
else if (palette == JKQTPMathImageBLUEWHITERED) //gnuplot: 34,13,-34
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(8.0, 0xFFB2182B);
|
||||
lst<<qMakePair<double, QRgb>(7.0, 0xFFD6604D);
|
||||
@ -1103,11 +1103,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
}
|
||||
else if (palette == JKQTPMathImageREDWHITEBLUE) //gnuplot: https://github.com/aschn/gnuplot-colorbrewer/blob/master/diverging/RdBu.plt
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFFB2182B);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFFD6604D);
|
||||
@ -1128,11 +1128,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
} else if (palette == JKQTPMathImageBLACKBLUEREDYELLOW) //gnuplot: 7,5,15
|
||||
{
|
||||
// int*& plut=&lut_BLACKBLUEREDYELLOW;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 255.0*qBound(0.0,sqrt(v),1.0);
|
||||
@ -1147,11 +1147,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
} else if (palette == JKQTPMathImageGREENREDVIOLET) //gnuplot: 3,11,6
|
||||
{
|
||||
//int*& plut=&lut_GREENREDVIOLET;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 255.0*qBound(0.0,v,1.0);
|
||||
@ -1166,11 +1166,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
} else if (palette == JKQTPMathImageBLACKBLUEVIOLETYELLOWWHITE) //gnuplot: 30,31,32
|
||||
{
|
||||
//int*& plut=&lut_BLACKBLUEVIOLETYELLOWWHITE;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 255.0*qBound(0.0,v/0.32-0.78125,1.0);
|
||||
@ -1185,11 +1185,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
} else if (palette == JKQTPMathImageWHITEYELLOWVIOLETBLUEBLACK) //gnuplot: 30,31,32
|
||||
{
|
||||
//int*& plut=&lut_WHITEYELLOWVIOLETBLUEBLACK;
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
double r = 255.0*qBound(0.0,v/0.32-0.78125,1.0);
|
||||
@ -1203,11 +1203,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageBR_GR) //https://github.com/aschn/gnuplot-colorbrewer/blob/master/diverging/BrBG.plt
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, qRgb(0x8C, 0x51, 0x0A));
|
||||
lst<<qMakePair<double, QRgb>(1.0, qRgb(0xBF, 0x81, 0x2D));
|
||||
@ -1224,11 +1224,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageBR_GR_STEP) //https://github.com/aschn/gnuplot-colorbrewer/blob/master/diverging/BrBG.plt
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, qRgb(0x8C, 0x51, 0x0A));
|
||||
lst<<qMakePair<double, QRgb>(1.0, qRgb(0xBF, 0x81, 0x2D));
|
||||
@ -1245,11 +1245,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImagePU_OR) //https://github.com/aschn/gnuplot-colorbrewer/blob/master/diverging/PuOr.plt
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFFB35806);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFFE08214);
|
||||
@ -1267,11 +1267,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImagePU_OR_STEP) //https://github.com/aschn/gnuplot-colorbrewer/blob/master/diverging/PuOr.plt
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFFB35806);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFFE08214);
|
||||
@ -1289,11 +1289,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageYL_GN_BU) //http://colorbrewer2.org/
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFFFFFFD9);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFFEDF8B1);
|
||||
@ -1311,11 +1311,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageYL_GN_BU_STEP) //http://colorbrewer2.org/
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFFFFFFD9);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFFEDF8B1);
|
||||
@ -1334,11 +1334,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImageGN_BU) //http://colorbrewer2.org/
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFFF7FCF0);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFFE0F3DB);
|
||||
@ -1356,11 +1356,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageGN_BU_STEP) //http://colorbrewer2.org/
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFFF7FCF0);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFFE0F3DB);
|
||||
@ -1378,11 +1378,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageBU_GN) //http://colorbrewer2.org/
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(8.0, 0xFFF7FCF0);
|
||||
lst<<qMakePair<double, QRgb>(7.0, 0xFFE0F3DB);
|
||||
@ -1400,11 +1400,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageBU_GN_STEP) //http://colorbrewer2.org/
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(8.0, 0xFFF7FCF0);
|
||||
lst<<qMakePair<double, QRgb>(7.0, 0xFFE0F3DB);
|
||||
@ -1422,11 +1422,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageINVERTED_MAGENTA) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,1,0,v).rgba();
|
||||
@ -1437,11 +1437,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageMAGENTA) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,1,0,v).rgba();
|
||||
@ -1452,11 +1452,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageINVERTED_YELLOW) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,0,1,v).rgba();
|
||||
@ -1467,11 +1467,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageYELLOW) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,0,1,v).rgba();
|
||||
@ -1483,11 +1483,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImageINVERTED_MAGENTAWHITE) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,v,0,0).rgba();
|
||||
@ -1498,11 +1498,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageMAGENTAWHITE) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,v,0,0).rgba();
|
||||
@ -1513,11 +1513,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageINVERTED_YELLOWWHITE) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,0,v,0).rgba();
|
||||
@ -1528,11 +1528,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageYELLOWWHITE) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(0,0,v,0).rgba();
|
||||
@ -1544,11 +1544,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImageINVERTED_CYANWHITE) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(v,0,0,0).rgba();
|
||||
@ -1559,11 +1559,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageCYANWHITE) // from CMYK model
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
for (int l=0; l<=JKQTPimagePlot_LUTSIZE; l++) {
|
||||
double v=(JKQTPimagePlot_LUTSIZE-l)/(double)(JKQTPimagePlot_LUTSIZE);
|
||||
plut[l]=QColor::fromCmykF(v,0,0,0).rgba();
|
||||
@ -1574,11 +1574,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
lut_used=lutstore[palette];
|
||||
} else if (palette == JKQTPMathImageBlueGreenRed)
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(1.0, QColor("blue").rgb());
|
||||
lst<<qMakePair<double, QRgb>(2.0, QColor("green").rgb());
|
||||
@ -1591,11 +1591,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImageRedGreenBlue)
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(1.0, QColor("red").rgb());
|
||||
lst<<qMakePair<double, QRgb>(2.0, QColor("green").rgb());
|
||||
@ -1609,11 +1609,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImagePREDEFINED_PALETTES_COUNT)
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(1.0, QColor("magenta").rgb());
|
||||
lst<<qMakePair<double, QRgb>(2.0, QColor("yellow").rgb());
|
||||
@ -1625,11 +1625,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImagePREDEFINED_PALETTES_COUNT+1)
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(1.0, QColor("yellow").rgb());
|
||||
lst<<qMakePair<double, QRgb>(2.0, QColor("magenta").rgb());
|
||||
@ -1641,11 +1641,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImagePREDEFINED_PALETTES_COUNT+2)
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(1.0, QColor("red").rgb());
|
||||
lst<<qMakePair<double, QRgb>(2.0, QColor("blue").rgb());
|
||||
@ -1657,11 +1657,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (palette == JKQTPMathImagePREDEFINED_PALETTES_COUNT+3)
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(1.0, QColor("blue").rgb());
|
||||
lst<<qMakePair<double, QRgb>(2.0, QColor("red").rgb());
|
||||
@ -1675,11 +1675,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
/*
|
||||
} else if (palette == JKQTPMathImagePU_OR) //https://github.com/aschn/gnuplot-colorbrewer/blob/master/diverging/PuOr.plt
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
QList<QPair<double, QRgb> > lst;
|
||||
lst<<qMakePair<double, QRgb>(0.0, 0xFF);
|
||||
lst<<qMakePair<double, QRgb>(1.0, 0xFF);
|
||||
@ -1700,11 +1700,11 @@ int* JKQTPimagePlot_getCreateLUT(QList<int*>& lutstore, JKQTPMathImageColorPalet
|
||||
|
||||
} else if (JKQTPimagePlot_lutsFromFiles.contains(palette)) // LUTs read from files in JKQTPimagePlot_lutsFromFiles
|
||||
{
|
||||
if (lutstore[palette]==NULL) {
|
||||
if (lutstore[palette]==nullptr) {
|
||||
lutstore[palette]=(int*)malloc((JKQTPimagePlot_LUTSIZE+2)*sizeof(int));
|
||||
int* plut=lutstore[palette];
|
||||
//std::cout<<"!!! creating rainbow lut\n";
|
||||
if (plut!=NULL) {
|
||||
if (plut!=nullptr) {
|
||||
if (JKQTPimagePlot_lutsFromFiles[palette].size()>220) JKQTPimagePlot_buildDefinedPalette(plut, JKQTPimagePlot_lutsFromFiles[palette]);
|
||||
else JKQTPimagePlot_buildDefinedPaletteLinInterpolate(plut, JKQTPimagePlot_lutsFromFiles[palette]);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ enum JKQTPMathImageColorPalette {
|
||||
class LIB_EXPORT JKQTPMathImageColorPaletteComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPMathImageColorPaletteComboBox(QWidget* parent=NULL);
|
||||
JKQTPMathImageColorPaletteComboBox(QWidget* parent=nullptr);
|
||||
JKQTPMathImageColorPalette colorPalette() const;
|
||||
JKQTPMathImageColorPalette currentColorPalette() const;
|
||||
JKQTPMathImageColorPalette getColorPalette() const;
|
||||
@ -617,9 +617,9 @@ inline void JKQTPimagePlot_array2image(T* dbl_in, int width, int height, QImage
|
||||
double delta=max-min;
|
||||
|
||||
|
||||
int* lut_used=NULL;
|
||||
int* lut_used=nullptr;
|
||||
int lutSize=JKQTPimagePlot_LUTSIZE;
|
||||
if (global_jkqtpimagetools_lutstore.size()<=0) global_jkqtpimagetools_lutstore=JKQTPimagePlot_makeQList<int*>(NULL, JKQTPimagePlot_getPredefinedPalettes().size()+2);
|
||||
if (global_jkqtpimagetools_lutstore.size()<=0) global_jkqtpimagetools_lutstore=JKQTPimagePlot_makeQList<int*>(nullptr, JKQTPimagePlot_getPredefinedPalettes().size()+2);
|
||||
|
||||
|
||||
img = QImage(width, height, QImage::Format_ARGB32);
|
||||
@ -637,7 +637,7 @@ inline void JKQTPimagePlot_array2image(T* dbl_in, int width, int height, QImage
|
||||
}
|
||||
|
||||
|
||||
if (lut_used!=NULL && lutSize>0) {
|
||||
if (lut_used!=nullptr && lutSize>0) {
|
||||
// LUT found: collor the image accordingly
|
||||
for (register int j=0; j<height; ++j) {
|
||||
QRgb* line=(QRgb*)(img.scanLine(height-1-j));
|
||||
|
@ -55,13 +55,13 @@ JKQtPlotter::JKQtPlotter(bool datastore_internal, QWidget* parent, JKQTPdatastor
|
||||
JKQtPlotter::JKQtPlotter(QWidget *parent):
|
||||
QWidget(parent, Qt::Widget)
|
||||
{
|
||||
init(true, parent, NULL);
|
||||
init(true, parent, nullptr);
|
||||
}
|
||||
|
||||
void JKQtPlotter::init(bool datastore_internal, QWidget* parent, JKQTPdatastore* datast)
|
||||
{
|
||||
leftDoubleClickAction=LeftDoubleClickDefault;
|
||||
menuSpecialContextMenu=NULL;
|
||||
menuSpecialContextMenu=nullptr;
|
||||
mouseContextX=0;
|
||||
mouseContextY=0;
|
||||
setParent(parent);
|
||||
|
@ -100,8 +100,8 @@ class LIB_EXPORT JKQtPlotter: public QWidget {
|
||||
|
||||
/** \brief class constructor
|
||||
*/
|
||||
explicit JKQtPlotter(bool datastore_internal, QWidget* parent=NULL, JKQTPdatastore* datast=NULL);
|
||||
explicit JKQtPlotter(QWidget* parent=NULL);
|
||||
explicit JKQtPlotter(bool datastore_internal, QWidget* parent=nullptr, JKQTPdatastore* datast=nullptr);
|
||||
explicit JKQtPlotter(QWidget* parent=nullptr);
|
||||
|
||||
/** \brief class destructor */
|
||||
virtual ~JKQtPlotter();
|
||||
@ -352,8 +352,8 @@ class LIB_EXPORT JKQtPlotter: public QWidget {
|
||||
plotter->saveData(filename, format);
|
||||
}
|
||||
|
||||
/** \brief print the current plot, if printer is \c NULL a printer selection dialog is displayed */
|
||||
inline void print(QPrinter* printer=NULL) {
|
||||
/** \brief print the current plot, if printer is \c nullptr a printer selection dialog is displayed */
|
||||
inline void print(QPrinter* printer=nullptr) {
|
||||
plotter->print(printer);
|
||||
}
|
||||
|
||||
|
@ -661,10 +661,10 @@ std::string JKQTPMathParser::currenttokentostring() {
|
||||
|
||||
// class constructor
|
||||
JKQTPMathParser::JKQTPMathParser() {
|
||||
jkmathparser_exception_function=NULL;
|
||||
data=NULL;
|
||||
jkmathparser_exception_function=nullptr;
|
||||
data=nullptr;
|
||||
argc=0;
|
||||
argv=NULL;
|
||||
argv=nullptr;
|
||||
addStandardFunctions();
|
||||
addStandardVariables();
|
||||
}
|
||||
@ -966,7 +966,7 @@ JKQTPMathParser::jkmpEvaluateFunc JKQTPMathParser::getFunctionDef(std::string na
|
||||
//std::cout <<name<<std::endl;
|
||||
jkmpError(jkqtp_format("function '%s' does not exist (getFunctionDef)", name.c_str()));
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void JKQTPMathParser::addTempVariable(std::string name, JKQTPMathParser::jkmpResult value) {
|
||||
@ -1151,7 +1151,7 @@ JKQTPMathParser::jkmpTokenType JKQTPMathParser::getToken(){
|
||||
|
||||
JKQTPMathParser::jkmpNode* JKQTPMathParser::parse(std::string prog){
|
||||
program=new std::istringstream(prog);
|
||||
JKQTPMathParser::jkmpNode* res=NULL;
|
||||
JKQTPMathParser::jkmpNode* res=nullptr;
|
||||
JKQTPMathParser::jkmpNodeList* resList=new JKQTPMathParser::jkmpNodeList(this);
|
||||
while(true) {
|
||||
getToken();
|
||||
@ -1183,13 +1183,13 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::logicalExpression(bool get){
|
||||
for(;;) // forever, do until you find anything else than an expressions
|
||||
switch(CurrentToken) {
|
||||
case LOGIC_OR:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPor, left, logicalTerm(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPor, left, logicalTerm(true), this, nullptr);
|
||||
break;
|
||||
case LOGIC_XOR:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPxor, left, logicalTerm(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPxor, left, logicalTerm(true), this, nullptr);
|
||||
break;
|
||||
case LOGIC_NOR:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPnor, left, logicalTerm(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPnor, left, logicalTerm(true), this, nullptr);
|
||||
break;
|
||||
default:
|
||||
return left;
|
||||
@ -1202,10 +1202,10 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::logicalTerm(bool get){
|
||||
for(;;) // forever, do until you find anything else than an expressions
|
||||
switch(CurrentToken) {
|
||||
case LOGIC_AND:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPand, left, compExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPand, left, compExpression(true), this, nullptr);
|
||||
break;
|
||||
case LOGIC_NAND:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPnand, left, compExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryBoolNode(jkmpLOPnand, left, compExpression(true), this, nullptr);
|
||||
break;
|
||||
default:
|
||||
return left;
|
||||
@ -1218,22 +1218,22 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::compExpression(bool get){
|
||||
for(;;) // forever, do until you find anything else than an expressions
|
||||
switch(CurrentToken) {
|
||||
case COMP_EQUALT:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPequal, left, mathExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPequal, left, mathExpression(true), this, nullptr);
|
||||
break;
|
||||
case COMP_UNEQUAL:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPnequal, left, mathExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPnequal, left, mathExpression(true), this, nullptr);
|
||||
break;
|
||||
case COMP_GREATER:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPgreater, left, mathExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPgreater, left, mathExpression(true), this, nullptr);
|
||||
break;
|
||||
case COMP_SMALLER:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPlesser, left, mathExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPlesser, left, mathExpression(true), this, nullptr);
|
||||
break;
|
||||
case COMP_GEQUAL:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPgreaterequal, left, mathExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPgreaterequal, left, mathExpression(true), this, nullptr);
|
||||
break;
|
||||
case COMP_SEQUAL:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPlesserequal, left, mathExpression(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpCompareNode(jkmpCOMPlesserequal, left, mathExpression(true), this, nullptr);
|
||||
break;
|
||||
default:
|
||||
return left;
|
||||
@ -1247,10 +1247,10 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::mathExpression(bool get){
|
||||
for(;;) // forever, do until you find anything else than an expressions
|
||||
switch(CurrentToken) {
|
||||
case PLUS:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('+', left, mathTerm(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('+', left, mathTerm(true), this, nullptr);
|
||||
break;
|
||||
case MINUS:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('-', left, mathTerm(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('-', left, mathTerm(true), this, nullptr);
|
||||
break;
|
||||
default:
|
||||
return left;
|
||||
@ -1263,13 +1263,13 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::mathTerm(bool get){
|
||||
for(;;) // forever, do until you find anything else than a term
|
||||
switch(CurrentToken) {
|
||||
case MUL:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('*', left, primary(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('*', left, primary(true), this, nullptr);
|
||||
break;
|
||||
case DIV:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('/', left, primary(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('/', left, primary(true), this, nullptr);
|
||||
break;
|
||||
case MODULO:
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('%', left, primary(true), this, NULL);
|
||||
left= (JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('%', left, primary(true), this, nullptr);
|
||||
break;
|
||||
default:
|
||||
return left;
|
||||
@ -1277,7 +1277,7 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::mathTerm(bool get){
|
||||
}
|
||||
|
||||
JKQTPMathParser::jkmpNode* JKQTPMathParser::primary(bool get){
|
||||
JKQTPMathParser::jkmpNode* res=NULL;
|
||||
JKQTPMathParser::jkmpNode* res=nullptr;
|
||||
|
||||
if (get) getToken();
|
||||
|
||||
@ -1287,16 +1287,16 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::primary(bool get){
|
||||
val.type=JKQTPMathParser::jkmpDouble;
|
||||
val.num=NumberValue;
|
||||
getToken();
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, NULL);
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, nullptr);
|
||||
break;
|
||||
}
|
||||
|
||||
case NAME: {
|
||||
//jkMathParser::jkmpNode* def=NULL;
|
||||
//jkMathParser::jkmpNode* def=nullptr;
|
||||
std::string varname=StringValue;
|
||||
getToken();
|
||||
if (CurrentToken == ASSIGN) { // assign a variable name
|
||||
res=new jkmpVariableAssignNode(varname, logicalExpression(true), this, NULL);
|
||||
res=new jkmpVariableAssignNode(varname, logicalExpression(true), this, nullptr);
|
||||
} else if (CurrentToken == LBRACKET) { // function found
|
||||
JKQTPMathParser::jkmpNode** params=(JKQTPMathParser::jkmpNode**)malloc(255*sizeof(JKQTPMathParser::jkmpNode*));
|
||||
unsigned char num=0;
|
||||
@ -1312,19 +1312,19 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::primary(bool get){
|
||||
}
|
||||
|
||||
if ( CurrentToken != RBRACKET ) jkmpError(jkqtp_format("')' expected, but '%s' found", currenttokentostring().c_str()));;
|
||||
JKQTPMathParser::jkmpNode** p=NULL;
|
||||
JKQTPMathParser::jkmpNode** p=nullptr;
|
||||
if (num>0) {
|
||||
p=(JKQTPMathParser::jkmpNode**)malloc(sizeof(JKQTPMathParser::jkmpNode*) * num);
|
||||
for (int i=0; i<num; i++) {
|
||||
p[i]=params[i];
|
||||
}
|
||||
}
|
||||
res=new jkmpFunctionNode(varname, p, num, this, NULL);
|
||||
res=new jkmpFunctionNode(varname, p, num, this, nullptr);
|
||||
free(params);
|
||||
getToken();
|
||||
|
||||
} else {
|
||||
res=(JKQTPMathParser::jkmpNode*)new jkmpVariableNode(varname, this, NULL);
|
||||
res=(JKQTPMathParser::jkmpNode*)new jkmpVariableNode(varname, this, nullptr);
|
||||
}
|
||||
//res= def;
|
||||
break;
|
||||
@ -1335,17 +1335,17 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::primary(bool get){
|
||||
JKQTPMathParser::jkmpResult val;
|
||||
val.type=JKQTPMathParser::jkmpString;
|
||||
val.str=readDelim('"');
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, NULL);
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, nullptr);
|
||||
getToken();
|
||||
break;
|
||||
}
|
||||
|
||||
case MINUS: // found primary: - primary
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpUnaryNode('-', primary(true), this, NULL);
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpUnaryNode('-', primary(true), this, nullptr);
|
||||
break;
|
||||
|
||||
case LOGIC_NOT:
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpUnaryNode('!', primary(true), this, NULL);
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpUnaryNode('!', primary(true), this, nullptr);
|
||||
break;
|
||||
|
||||
case LBRACKET: { // found primary ( expression )
|
||||
@ -1360,7 +1360,7 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::primary(bool get){
|
||||
JKQTPMathParser::jkmpResult val;
|
||||
val.type=JKQTPMathParser::jkmpBool;
|
||||
val.boolean=true;
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, NULL);
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, nullptr);
|
||||
getToken();
|
||||
break;
|
||||
}
|
||||
@ -1368,7 +1368,7 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::primary(bool get){
|
||||
JKQTPMathParser::jkmpResult val;
|
||||
val.type=JKQTPMathParser::jkmpBool;
|
||||
val.boolean=false;
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, NULL);
|
||||
res= (JKQTPMathParser::jkmpNode*)new jkmpConstantNode(val, this, nullptr);
|
||||
getToken();
|
||||
break;
|
||||
}
|
||||
@ -1379,7 +1379,7 @@ JKQTPMathParser::jkmpNode* JKQTPMathParser::primary(bool get){
|
||||
}
|
||||
|
||||
if (CurrentToken==POWER) {
|
||||
res=(JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('^', res, primary(true), this, NULL);
|
||||
res=(JKQTPMathParser::jkmpNode*)new jkmpBinaryArithmeticNode('^', res, primary(true), this, nullptr);
|
||||
}
|
||||
|
||||
return res;
|
||||
@ -1808,7 +1808,7 @@ JKQTPMathParser::jkmpFunctionNode::~jkmpFunctionNode() {
|
||||
delete child[i];
|
||||
}
|
||||
}*/
|
||||
if ((child!=NULL) && (n>0)) {
|
||||
if ((child!=nullptr) && (n>0)) {
|
||||
for (int i=0; i<n; i++) {
|
||||
delete child[i];
|
||||
}
|
||||
@ -1829,9 +1829,9 @@ JKQTPMathParser::jkmpVariable::jkmpVariable()
|
||||
{
|
||||
type=jkmpDouble; /*!< \brief type of the variable */
|
||||
internal=false; /*!< \brief this is an internal variable */
|
||||
str=NULL; /*!< \brief this points to the variable data if \c type==jkmpString */
|
||||
num=NULL; /*!< \brief this points to the variable data if \c type==jkmpDouble */
|
||||
boolean=NULL;
|
||||
str=nullptr; /*!< \brief this points to the variable data if \c type==jkmpString */
|
||||
num=nullptr; /*!< \brief this points to the variable data if \c type==jkmpDouble */
|
||||
boolean=nullptr;
|
||||
}
|
||||
|
||||
void JKQTPMathParser::setArgCV(int argc, char **argv) {
|
||||
|
@ -643,7 +643,7 @@ class JKQTPMathParser
|
||||
/** \brief constructor for a jkmpNodeList
|
||||
* \param p a pointer to a jkMathParser object
|
||||
*/
|
||||
jkmpNodeList(JKQTPMathParser* p) { setParser(p); setParent(NULL); };
|
||||
jkmpNodeList(JKQTPMathParser* p) { setParser(p); setParent(nullptr); };
|
||||
|
||||
/** \brief standard destructor, also destroy the children (recursively) */
|
||||
~jkmpNodeList();
|
||||
@ -676,7 +676,7 @@ class JKQTPMathParser
|
||||
* \attention If you do not want to use the exception handling which throws
|
||||
* jkmpException exceptions, but want to write your own error handling, you should write your own
|
||||
* error handler and assign it (function pointer) to the global variable jkmathparser_exception_function.
|
||||
* If this is not NULL this function will be called instead of throwing an exception.
|
||||
* If this is not nullptr this function will be called instead of throwing an exception.
|
||||
*/
|
||||
class jkmpException : public std::exception {
|
||||
private:
|
||||
@ -711,7 +711,7 @@ class JKQTPMathParser
|
||||
|
||||
/** \brief macro that throws an exception or calls an error handler */
|
||||
inline void jkmpError(std::string st) {
|
||||
if (jkmathparser_exception_function!=NULL) {
|
||||
if (jkmathparser_exception_function!=nullptr) {
|
||||
jkmathparser_exception_function(st);
|
||||
} else {
|
||||
throw jkmpException(st);
|
||||
@ -719,7 +719,7 @@ class JKQTPMathParser
|
||||
};
|
||||
|
||||
private:
|
||||
/** \brief if this is NULL then an exception may be thrown otherwise this should point to an error handler that will be called. */
|
||||
/** \brief if this is nullptr then an exception may be thrown otherwise this should point to an error handler that will be called. */
|
||||
jkmpexceptionf jkmathparser_exception_function;
|
||||
|
||||
public:
|
||||
@ -730,7 +730,7 @@ class JKQTPMathParser
|
||||
|
||||
/** \brief deactivate error handling by use of an exception function */
|
||||
inline void reset_exception_function() {
|
||||
jkmathparser_exception_function=NULL;
|
||||
jkmathparser_exception_function=nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
@ -59,7 +59,7 @@ JKQTPxParsedFunctionLineGraph::JKQTPxParsedFunctionLineGraph(JKQtBasePlotter *pa
|
||||
JKQTPxFunctionLineGraph(parent)
|
||||
{
|
||||
fdata.parser=new JKQTPMathParser();
|
||||
fdata.node=NULL;
|
||||
fdata.node=nullptr;
|
||||
fdata.varcount=0;
|
||||
function="";
|
||||
parameterColumn=-1;
|
||||
@ -67,7 +67,7 @@ JKQTPxParsedFunctionLineGraph::JKQTPxParsedFunctionLineGraph(JKQtBasePlotter *pa
|
||||
set_plotFunction(JKQTPxParsedFunctionLineGraphFunction);
|
||||
|
||||
efdata.parser=new JKQTPMathParser();
|
||||
efdata.node=NULL;
|
||||
efdata.node=nullptr;
|
||||
efdata.varcount=0;
|
||||
errorFunction="";
|
||||
errorParameterColumn=-1;
|
||||
@ -79,7 +79,7 @@ JKQTPxParsedFunctionLineGraph::JKQTPxParsedFunctionLineGraph(JKQtPlotter *parent
|
||||
JKQTPxFunctionLineGraph(parent)
|
||||
{
|
||||
fdata.parser=new JKQTPMathParser();
|
||||
fdata.node=NULL;
|
||||
fdata.node=nullptr;
|
||||
fdata.varcount=0;
|
||||
function="";
|
||||
parameterColumn=-1;
|
||||
@ -87,7 +87,7 @@ JKQTPxParsedFunctionLineGraph::JKQTPxParsedFunctionLineGraph(JKQtPlotter *parent
|
||||
set_plotFunction(JKQTPxParsedFunctionLineGraphFunction);
|
||||
|
||||
efdata.parser=new JKQTPMathParser();
|
||||
efdata.node=NULL;
|
||||
efdata.node=nullptr;
|
||||
efdata.varcount=0;
|
||||
errorFunction="";
|
||||
errorParameterColumn=-1;
|
||||
@ -186,7 +186,7 @@ void JKQTPxParsedFunctionLineGraph::createPlotData(bool /*collectParams*/)
|
||||
|
||||
/*int count=0;
|
||||
doublePair* d=data;
|
||||
while (d!=NULL) {
|
||||
while (d!=nullptr) {
|
||||
count++;
|
||||
d=d->next;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class LIB_EXPORT JKQTPxParsedFunctionLineGraph: public JKQTPxFunctionLineGraph {
|
||||
|
||||
|
||||
/** \brief class constructor */
|
||||
JKQTPxParsedFunctionLineGraph(JKQtBasePlotter* parent=NULL);
|
||||
JKQTPxParsedFunctionLineGraph(JKQtBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
JKQTPxParsedFunctionLineGraph(JKQtPlotter* parent);
|
||||
|
||||
|
@ -49,12 +49,12 @@ int JKQTPPlotsModel::columnCount(const QModelIndex &/*parent*/) const
|
||||
QVariant JKQTPPlotsModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role == Qt::DisplayRole) {
|
||||
if (index.row()<m_plotter->getGraphCount()) return m_plotter->getGraph(index.row())->get_title();
|
||||
if (index.row()<static_cast<int>(m_plotter->getGraphCount())) return m_plotter->getGraph(static_cast<size_t>(index.row()))->get_title();
|
||||
} else if (role == Qt::CheckStateRole) {
|
||||
if (index.row()<m_plotter->getGraphCount()) return m_plotter->getGraph(index.row())->get_visible()?Qt::Checked:Qt::Unchecked;
|
||||
if (index.row()<static_cast<int>(m_plotter->getGraphCount())) return m_plotter->getGraph(static_cast<size_t>(index.row()))->get_visible()?Qt::Checked:Qt::Unchecked;
|
||||
} else if (role == Qt::DecorationRole) {
|
||||
if (index.row()<m_plotter->getGraphCount()) {
|
||||
return m_plotter->getGraph(index.row())->generateKeyMarker(QSize(16,16));
|
||||
if (index.row()<static_cast<int>(m_plotter->getGraphCount())) {
|
||||
return m_plotter->getGraph(static_cast<size_t>(index.row()))->generateKeyMarker(QSize(16,16));
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
@ -63,7 +63,7 @@ QVariant JKQTPPlotsModel::data(const QModelIndex &index, int role) const
|
||||
bool JKQTPPlotsModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
{
|
||||
if (role == Qt::CheckStateRole) {
|
||||
if (index.row()<m_plotter->getGraphCount()) {
|
||||
if (index.row()<static_cast<int>(m_plotter->getGraphCount())) {
|
||||
m_plotter->setGraphVisible(index.row(), value.toBool());
|
||||
return true;
|
||||
}
|
||||
|
@ -1465,7 +1465,7 @@ void JKQTPEnhancedTableView::keyPressEvent(QKeyEvent *event)
|
||||
|
||||
void JKQTPEnhancedTableView::print()
|
||||
{
|
||||
QPrinter* tablePrinter=getPrinter(NULL);
|
||||
QPrinter* tablePrinter=getPrinter(nullptr);
|
||||
|
||||
if (tablePrinter) {
|
||||
QDialog* dlg=new QDialog(this);
|
||||
@ -1737,12 +1737,12 @@ void JKQTPEnhancedTableView::paint(QPainter &painter, double scale, int page, do
|
||||
QPrinter *JKQTPEnhancedTableView::getPrinter(QPrinter *printerIn, bool *localPrinter)
|
||||
{
|
||||
QPrinter* p=printerIn;
|
||||
if (p==NULL) {
|
||||
if (p==nullptr) {
|
||||
p=new QPrinter();
|
||||
if (localPrinter) *localPrinter=true;
|
||||
}
|
||||
|
||||
QPrintDialog *dialog = new QPrintDialog(p, NULL);
|
||||
QPrintDialog *dialog = new QPrintDialog(p, nullptr);
|
||||
dialog->setWindowTitle(tr("Print Table"));
|
||||
if (dialog->exec() != QDialog::Accepted) {
|
||||
if (localPrinter && *localPrinter) delete p;
|
||||
|
59
jkqtptools.h
59
jkqtptools.h
@ -435,7 +435,7 @@ class JKQTPEnhancedPainter; // forward
|
||||
*
|
||||
* This returns a QString which contains the name of named colors and the RGBA values in a QT readable form othertwise.
|
||||
*/
|
||||
#define QColor2String(color) QString(jkqtp_rgbtostring((color).red(), (color).green(), (color).blue(), (color).alpha()).c_str())
|
||||
#define QColor2String(color) QString(jkqtp_rgbtostring(static_cast<unsigned char>((color).red()), static_cast<unsigned char>((color).green()), static_cast<unsigned char>((color).blue()), static_cast<unsigned char>((color).alpha())).c_str())
|
||||
|
||||
/** \brief converts a QT::PenStyle into a string
|
||||
* \ingroup jkqtptools
|
||||
@ -476,7 +476,7 @@ enum JKQTPCAdrawMode {
|
||||
class LIB_EXPORT JKQTPCAdrawModeComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPCAdrawModeComboBox(QWidget* parent=NULL);
|
||||
JKQTPCAdrawModeComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPCAdrawMode getDrawMode() const;
|
||||
void setDrawMode(JKQTPCAdrawMode position);
|
||||
@ -533,7 +533,7 @@ LIB_EXPORT JKQTPLabelTickMode String2JKQTPLabelTickMode(QString pos);
|
||||
class LIB_EXPORT JKQTPCAlabelTypeComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPCAlabelTypeComboBox(QWidget* parent=NULL);
|
||||
JKQTPCAlabelTypeComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPCAlabelType getLabelType() const;
|
||||
void setLabelType(JKQTPCAlabelType position);
|
||||
@ -567,7 +567,7 @@ enum JKQTPlabelPosition {
|
||||
class LIB_EXPORT JKQTPlabelPositionComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPlabelPositionComboBox(QWidget* parent=NULL);
|
||||
JKQTPlabelPositionComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPlabelPosition getPosition() const;
|
||||
void setPosition(JKQTPlabelPosition position);
|
||||
@ -609,7 +609,7 @@ enum JKQTPkeyPosition {
|
||||
class LIB_EXPORT JKQTPkeyPositionComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPkeyPositionComboBox(QWidget* parent=NULL);
|
||||
JKQTPkeyPositionComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPkeyPosition getPosition() const;
|
||||
void setPosition(JKQTPkeyPosition position);
|
||||
@ -647,7 +647,7 @@ enum JKQTPkeyLayout {
|
||||
class LIB_EXPORT JKQTPkeyLayoutComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPkeyLayoutComboBox(QWidget* parent=NULL);
|
||||
JKQTPkeyLayoutComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPkeyLayout getKeyLayout() const;
|
||||
void setKeyLayout(JKQTPkeyLayout layout);
|
||||
@ -751,7 +751,7 @@ enum JKQTPerrorPlotstyle {
|
||||
class LIB_EXPORT JKQTPerrorPlotstyleComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPerrorPlotstyleComboBox(QWidget* parent=NULL);
|
||||
JKQTPerrorPlotstyleComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPerrorPlotstyle getErrorStyle() const;
|
||||
void setSymbol(JKQTPerrorPlotstyle symbol);
|
||||
@ -836,7 +836,7 @@ LIB_EXPORT JKQTPgraphSymbols String2JKQTPgraphSymbols(QString pos);
|
||||
class LIB_EXPORT JKQTPSymbolComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPSymbolComboBox(QWidget* parent=NULL);
|
||||
JKQTPSymbolComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPgraphSymbols getSymbol() const;
|
||||
void setSymbol(JKQTPgraphSymbols symbol);
|
||||
@ -852,7 +852,7 @@ class LIB_EXPORT JKQTPSymbolComboBox: public QComboBox {
|
||||
class LIB_EXPORT JKQTPLinePlotStyleComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPLinePlotStyleComboBox(QWidget* parent=NULL);
|
||||
JKQTPLinePlotStyleComboBox(QWidget* parent=nullptr);
|
||||
|
||||
void setDefaultSymbol(JKQTPgraphSymbols symbol);
|
||||
void addUsedSymbol(JKQTPgraphSymbols symbol);
|
||||
@ -873,7 +873,7 @@ class LIB_EXPORT JKQTPLinePlotStyleComboBox: public QComboBox {
|
||||
class LIB_EXPORT JKQTPLinePlotStyleWithSymbolSizeComboBox: public QComboBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPLinePlotStyleWithSymbolSizeComboBox(QWidget* parent=NULL);
|
||||
JKQTPLinePlotStyleWithSymbolSizeComboBox(QWidget* parent=nullptr);
|
||||
|
||||
void setDefaultSymbol(JKQTPgraphSymbols symbol, double size);
|
||||
void addUsedSymbol(JKQTPgraphSymbols symbol, double symbolSize, bool line);
|
||||
@ -959,7 +959,7 @@ LIB_EXPORT void plotSymbol(QPaintDevice& paintDevice, double x, double y, JKQTPg
|
||||
|
||||
\note all angles are given in degrees [0..360]
|
||||
*/
|
||||
LIB_EXPORT QVector<QPointF> draw_ellipse(double x, double y, double a, double b, double angle_start=0, double angle_end=360, double alpha=0, int controlPoints=180, QPointF* x_start=NULL, QPointF* x_end=NULL);
|
||||
LIB_EXPORT QVector<QPointF> draw_ellipse(double x, double y, double a, double b, double angle_start=0, double angle_end=360, double alpha=0, int controlPoints=180, QPointF* x_start=nullptr, QPointF* x_end=nullptr);
|
||||
|
||||
|
||||
#include <QDoubleSpinBox>
|
||||
@ -970,7 +970,7 @@ LIB_EXPORT QVector<QPointF> draw_ellipse(double x, double y, double a, double b,
|
||||
class LIB_EXPORT JKQTPEnhancedDoubleSpinBox : public QDoubleSpinBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPEnhancedDoubleSpinBox(QWidget* parent=NULL);
|
||||
JKQTPEnhancedDoubleSpinBox(QWidget* parent=nullptr);
|
||||
~JKQTPEnhancedDoubleSpinBox();
|
||||
signals:
|
||||
void editingFinished(double value);
|
||||
@ -988,7 +988,7 @@ class LIB_EXPORT JKQTPEnhancedDoubleSpinBox : public QDoubleSpinBox {
|
||||
class LIB_EXPORT JKQTPEnhancedSpinBox : public QSpinBox {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPEnhancedSpinBox(QWidget* parent=NULL);
|
||||
JKQTPEnhancedSpinBox(QWidget* parent=nullptr);
|
||||
~JKQTPEnhancedSpinBox();
|
||||
signals:
|
||||
void editingFinished(int value);
|
||||
@ -1026,7 +1026,7 @@ inline QString JKQTPDoubleToQString(double value, int prec = 10, char f = 'g', Q
|
||||
class LIB_EXPORT JKQTPEnhancedTableView : public QTableView {
|
||||
Q_OBJECT
|
||||
public:
|
||||
JKQTPEnhancedTableView(QWidget* parent=NULL);
|
||||
JKQTPEnhancedTableView(QWidget* parent=nullptr);
|
||||
virtual ~JKQTPEnhancedTableView();
|
||||
|
||||
/** \brief return the contents of the table view as HTML fragment */
|
||||
@ -1048,9 +1048,9 @@ class LIB_EXPORT JKQTPEnhancedTableView : public QTableView {
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent* event);
|
||||
void paint(QPainter &painter, double scale, int page, double hhh, double vhw, const QList<int>& pageCols, const QList<int>& pageRows, QPrinter* p=NULL);
|
||||
void paint(QPainter &painter, double scale, int page, double hhh, double vhw, const QList<int>& pageCols, const QList<int>& pageRows, QPrinter* p=nullptr);
|
||||
|
||||
QPrinter* getPrinter(QPrinter* printerIn=NULL, bool *localPrinter=NULL);
|
||||
QPrinter* getPrinter(QPrinter* printerIn=nullptr, bool *localPrinter=nullptr);
|
||||
QAction* printAction;
|
||||
private:
|
||||
};
|
||||
@ -1252,23 +1252,23 @@ inline void jkqtpQuicksort(T* a, T2* a2, long long l, long long r){
|
||||
\param input array to be sorted
|
||||
\param input2 array to be sorted
|
||||
\param N size of the array input
|
||||
\param output if \c !=NULL data is written here (the memory location pointed at by \a output has to have at least the length \a N !!!),
|
||||
\param output if \c !=nullptr data is written here (the memory location pointed at by \a output has to have at least the length \a N !!!),
|
||||
otherwise the array input is sorted inplace.
|
||||
\param output2 if \c !=NULL data is written here (the memory location pointed at by \a output has to have at least the length \a N !!!),
|
||||
\param output2 if \c !=nullptr data is written here (the memory location pointed at by \a output has to have at least the length \a N !!!),
|
||||
otherwise the array input is sorted inplace.
|
||||
|
||||
*/
|
||||
template <class T, class T2>
|
||||
inline void jkqtpSort(T* input, T2* input2, long long N, T* output=NULL, T2* output2=NULL) {
|
||||
inline void jkqtpSort(T* input, T2* input2, long long N, T* output=nullptr, T2* output2=nullptr) {
|
||||
if ((!input)) return ;
|
||||
if (N<=0) return;
|
||||
T* data=input;
|
||||
if (output!=NULL) {
|
||||
if (output!=nullptr) {
|
||||
data=output;
|
||||
memcpy(output, input, N*sizeof(T));
|
||||
}
|
||||
T2* data2=input2;
|
||||
if (output2!=NULL && input2!=NULL) {
|
||||
if (output2!=nullptr && input2!=nullptr) {
|
||||
data2=output2;
|
||||
memcpy(output2, input2, N*sizeof(T2));
|
||||
}
|
||||
@ -1315,4 +1315,21 @@ LIB_EXPORT std::string jkqtp_floattounitstr(double data, int past_comma=5, bool
|
||||
LIB_EXPORT std::string jkqtp_floattolatexstr(double data, int past_comma=5, bool remove_trail0=false, double belowIsZero=1e-16, double minNoExponent=1e-3, double maxNoExponent=1e4);
|
||||
LIB_EXPORT std::string jkqtp_floattohtmlstr(double data, int past_comma=5, bool remove_trail0=false, double belowIsZero=1e-16, double minNoExponent=1e-3, double maxNoExponent=1e4);
|
||||
LIB_EXPORT std::string jkqtp_chartostr(char data);
|
||||
|
||||
/** \brief wandelt einen Datentyp in einen double um, wird von JKQTPDatastore zur Wandlung benutzt
|
||||
*
|
||||
* Diese Funktion nutzt per default static_cast<double>(), kann aber für spezielle Datentypen überschrieben werden, etwa für bool
|
||||
*/
|
||||
template<typename T>
|
||||
inline constexpr double jkqtp_todouble(const T& d) {
|
||||
return static_cast<double>(d);
|
||||
}
|
||||
|
||||
|
||||
/** \brief wandelt einen boolean in einen double um, wird von JKQTPDatastore zur Wandlung benutzt,
|
||||
* Spezialisierung für bool (true -> 1.0, false -> 0.0) */
|
||||
template<>
|
||||
inline constexpr double jkqtp_todouble(const bool& d) {
|
||||
return static_cast<double>((d)?1.0:0.0);
|
||||
}
|
||||
#endif // JKQTPTOOLS_H_INCLUDED
|
||||
|
@ -343,7 +343,7 @@ void EmfPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF
|
||||
int height = qRound(r.height());
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
HBITMAP hbtmp = NULL;
|
||||
HBITMAP hbtmp = nullptr;
|
||||
DWORD op = SRCCOPY;
|
||||
if (pm.hasAlpha()){
|
||||
QImage image = pm.scaled(width, height).toImage();
|
||||
@ -457,13 +457,13 @@ void EmfPaintEngine::resetClipping()
|
||||
{
|
||||
#ifdef Q_WS_WIN
|
||||
if (painter()->hasClipping())
|
||||
SelectClipRgn(metaDC, NULL);
|
||||
SelectClipRgn(metaDC, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
HPEN EmfPaintEngine::convertPen(const QPen& pen)
|
||||
{
|
||||
INT style = PS_NULL;
|
||||
INT style = PS_nullptr;
|
||||
switch (pen.style()){
|
||||
case Qt::SolidLine:
|
||||
style = PS_SOLID;
|
||||
@ -528,12 +528,12 @@ HPEN EmfPaintEngine::convertPen(const QPen& pen)
|
||||
}
|
||||
|
||||
LOGBRUSH lbrush = {BS_SOLID, RGB(pen.color().red(),pen.color().green(),pen.color().blue()), 0};
|
||||
return ExtCreatePen(PS_GEOMETRIC | style | capStyle | joinStyle, pen.width(), &lbrush, 0, NULL);
|
||||
return ExtCreatePen(PS_GEOMETRIC | style | capStyle | joinStyle, pen.width(), &lbrush, 0, nullptr);
|
||||
}
|
||||
|
||||
HBRUSH EmfPaintEngine::convertBrush(const QBrush& brush)
|
||||
{
|
||||
LOGBRUSH lbrush = {BS_NULL, 0, 0};
|
||||
LOGBRUSH lbrush = {BS_nullptr, 0, 0};
|
||||
|
||||
if (!brush.color().alpha())
|
||||
return CreateBrushIndirect( &lbrush );
|
||||
@ -562,7 +562,7 @@ HBRUSH EmfPaintEngine::convertBrush(const QBrush& brush)
|
||||
UINT lbStyle = BS_HATCHED;
|
||||
switch(brush.style()){
|
||||
case Qt::NoBrush:
|
||||
lbStyle = BS_NULL;
|
||||
lbStyle = BS_nullptr;
|
||||
break;
|
||||
|
||||
case Qt::SolidPattern:
|
||||
|
@ -99,7 +99,7 @@ private:
|
||||
//! Converts a QPen to a GDI+ Pen structure
|
||||
Pen *convertPen(const QPen& pen);
|
||||
//! Converts a QBrush to a GDI+ Brush structure
|
||||
Brush *convertBrush(const QBrush& brush, GraphicsPath *origPath = NULL);
|
||||
Brush *convertBrush(const QBrush& brush, GraphicsPath *origPath = nullptr);
|
||||
//! Draws pixmap pix in a given rectangle
|
||||
void drawPixmap(const QPixmap &pix, const RectF &p);
|
||||
//! Constructs a texture brush based on pixmap pix
|
||||
|
@ -431,7 +431,7 @@ TestMain::TestMain(QWidget *parent) :
|
||||
for (int y=0; y<100; y++) {
|
||||
img2[y*100+x]=sin(2*M_PI*sqrt(1.0+x*x+y*y)/20);
|
||||
img2M[y*100+x]=abs(y-x);
|
||||
bimg2[y*100+x]=(double)rand()/(double)RAND_MAX>0.9;
|
||||
bimg2[y*100+x]=static_cast<double>(rand())/static_cast<double>(RAND_MAX)>0.9;
|
||||
}
|
||||
}
|
||||
pimg2=new JKQTPMathImage(10,0,10,10, JKQTPMathImageBase::DoubleArray, img2, 100, 100, JKQTPMathImageGRAY, plotImg->get_plotter());
|
||||
@ -664,7 +664,7 @@ TestMain::TestMain(QWidget *parent) :
|
||||
// plotter for images
|
||||
QWidget* winrgb=new QWidget(this);
|
||||
QVBoxLayout* layoutrgb=new QVBoxLayout(this);
|
||||
QFormLayout* frm=new QFormLayout(NULL);
|
||||
QFormLayout* frm=new QFormLayout(nullptr);
|
||||
winrgb->setLayout(layoutrgb);
|
||||
winrgb->resize(1000, 800);
|
||||
plotImgRGB=new JKQtPlotter(true, winrgb);
|
||||
@ -828,8 +828,8 @@ TestMain::TestMain(QWidget *parent) :
|
||||
for (int i=0; i<1000; i++) {
|
||||
double x=double(i)/1000.0;
|
||||
const double p=0.33*fabs(sin(x*4.0*M_PI))*fabs(sin(x*4.0*M_PI));
|
||||
if ((double)rand()/(double)RAND_MAX<=p) photons1<<x;
|
||||
if ((double)rand()/(double)RAND_MAX<=p) photons2<<x;
|
||||
if (static_cast<double>(rand())/static_cast<double>(RAND_MAX)<=p) photons1<<x;
|
||||
if (static_cast<double>(rand())/static_cast<double>(RAND_MAX)<=p) photons2<<x;
|
||||
}
|
||||
int phot1=plotPeaks->getDatastore()->addCopiedColumn(photons1.data(), photons1.size(), "photons 1");
|
||||
int phot2=plotPeaks->getDatastore()->addCopiedColumn(photons2.data(), photons2.size(), "photons 2");
|
||||
@ -1263,21 +1263,21 @@ void TestMain::updateRGBChannels()
|
||||
rgbimg->set_data(rgb_rimg2, 100, 100);
|
||||
rgbimg2->set_imageRColumn(rgb_colr);
|
||||
} else {
|
||||
rgbimg->set_data(NULL, 100, 100);
|
||||
rgbimg->set_data(nullptr, 100, 100);
|
||||
rgbimg2->set_imageRColumn(-1);
|
||||
}
|
||||
if (chkRGBUseG->isChecked()) {
|
||||
rgbimg->set_dataG(rgb_gimg2);
|
||||
rgbimg2->set_imageGColumn(rgb_colg);
|
||||
} else {
|
||||
rgbimg->set_dataG(NULL);
|
||||
rgbimg->set_dataG(nullptr);
|
||||
rgbimg2->set_imageGColumn(-1);
|
||||
}
|
||||
if (chkRGBUseB->isChecked()) {
|
||||
rgbimg->set_dataB(rgb_bimg2);
|
||||
rgbimg2->set_imageBColumn(rgb_colb);
|
||||
} else {
|
||||
rgbimg->set_dataB(NULL);
|
||||
rgbimg->set_dataB(nullptr);
|
||||
rgbimg2->set_imageBColumn(-1);
|
||||
}
|
||||
plotImgRGB->update_plot();
|
||||
|
Loading…
Reference in New Issue
Block a user