mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
some fixes to documentation and geometry example
This commit is contained in:
parent
4e1c09c24b
commit
35000a8e38
@ -21,7 +21,7 @@ Changes, compared to \ref page_whatsnew_V2019_11 "v2019.11" include:
|
||||
<li> fixed issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/37">#37: CMake installs things into $PREFIX/doc/*.txt </a>, thanks to <a href="https://github.com/certik">user:certik</a></li>
|
||||
<li> fixed issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/45">#45: Build error on mac jkqtfastplotter.cpp:342:28: Variable has incomplete type 'QPainterPath'</a>, thanks to <a href="https://github.com/abdedixit">user:abdedixit</a></li>
|
||||
<li>removed the usage of some deprecated functions and objects (e.g. QMatrix)</li>
|
||||
<li> new: added geometric plot object JKQTPGeoArrow to draw (double-ended) arrows</li>
|
||||
<li> new: added geometric plot objects JKQTPGeoArrow to draw arrows (aka lines with added line-end decorators, also extended JKQTPGeoLine, JKQTPGeoInfiniteLine, JKQTPGeoPolyLines to draw line-end decorator (aka arrows)</li>
|
||||
</ul>
|
||||
|
||||
\subsection page_whatsnew_TRUNK_DOWNLOAD trunk: Download
|
||||
|
@ -29,7 +29,7 @@ The source code of the main application can be found in [`geometric.cpp`](https
|
||||
|
||||
// a polyline
|
||||
QVector<QPointF> p;
|
||||
p<<QPointF(1, 0.1)<<QPointF(1.3, 0.9)<<QPointF(1.6, 0.3)<<QPointF(1.9, 0.8);
|
||||
p<<QPointF(2.1, 0.0)<<QPointF(2.2, 0.92)<<QPointF(2.6, 0.3)<<QPointF(2.9, 0.9);
|
||||
plot.addGraph(new JKQTPGeoPolyLines(&plot, p, QColor("darkgreen"), 4, Qt::PenStyle::DashDotLine));
|
||||
|
||||
|
||||
@ -45,15 +45,17 @@ The source code of the main application can be found in [`geometric.cpp`](https
|
||||
plot.addGraph(new JKQTPGeoEllipse(&plot, 0.5,1.5,0.8,0.5, 35, QColor("darkblue"), 2, Qt::DashLine));
|
||||
|
||||
|
||||
|
||||
// a polygon
|
||||
JKQTPGeoPolygon* polygraph=new JKQTPGeoPolygon(&plot, QColor("red"), 2, Qt::PenStyle::DashLine, QColor("salmon"));
|
||||
polygraph->appendPoint(2.1, 0.5);
|
||||
polygraph->appendPoint(2.9, 0.9);
|
||||
polygraph->appendPoint(2.2, 0.8);
|
||||
polygraph->appendPoint(2.8, 0.25);
|
||||
polygraph->appendPoint(2.6, 0.6);
|
||||
polygraph->setAlpha(0.75);
|
||||
plot.addGraph(polygraph);
|
||||
JKQTPGeoPolygon* polygongraph=new JKQTPGeoPolygon(&plot, QColor("red"), 2, Qt::PenStyle::DashLine, QColor("salmon"));
|
||||
polygongraph->appendPoint(2.1, 0.5);
|
||||
polygongraph->appendPoint(2.9, 0.9);
|
||||
polygongraph->appendPoint(2.2, 0.8);
|
||||
polygongraph->appendPoint(2.8, 0.25);
|
||||
polygongraph->appendPoint(2.6, 0.6);
|
||||
polygongraph->setAlpha(0.75);
|
||||
plot.addGraph(polygongraph);
|
||||
|
||||
|
||||
|
||||
// an arc from an ellipse from -10 degrees to 117 degrees, centered at 2.5,1.5 and full axes of 0.5 and 0.5
|
||||
|
@ -40,13 +40,10 @@ int main(int argc, char* argv[])
|
||||
plot.addGraph(new JKQTPGeoSymbol(&plot, 0.1,0.6, JKQTPCircle, 5, QColor("grey")));
|
||||
|
||||
|
||||
// 3.2 some lines elements (single lines and polylines)
|
||||
// 3.2 some lines elements (single lines)
|
||||
plot.addGraph(new JKQTPGeoText(&plot, 1.1,0.95, "\\textbf{Lines:}", 14, QColor("red")));
|
||||
plot.addGraph(new JKQTPGeoLine(&plot, 1, 0.05, 1.9, 0.9, QColor("red"), 2));
|
||||
plot.addGraph(new JKQTPGeoLine(&plot, 1, 0.1, 1.9, 0.8, QColor("blue"), 1, Qt::PenStyle::DashLine));
|
||||
QVector<QPointF> p;
|
||||
p<<QPointF(1, 0.1)<<QPointF(1.3, 0.9)<<QPointF(1.6, 0.3)<<QPointF(1.9, 0.8);
|
||||
plot.addGraph(new JKQTPGeoPolyLines(&plot, p, QColor("darkgreen"), 4, Qt::PenStyle::DashDotLine));
|
||||
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(&plot, 1.7, 0.2, 0.2, 0.25, QColor("green"), 1.5, Qt::PenStyle::DashLine);
|
||||
infLine->setTwoSided(false);
|
||||
infLine->setAlpha(0.5);
|
||||
@ -129,7 +126,13 @@ int main(int argc, char* argv[])
|
||||
plot.addGraph(polygraph);
|
||||
|
||||
|
||||
// 3.7 some arcs
|
||||
// 3.7 a poly-line element
|
||||
QVector<QPointF> p;
|
||||
p<<QPointF(2.1, 0.0)<<QPointF(2.2, 0.92)<<QPointF(2.6, 0.3)<<QPointF(2.9, 0.9);
|
||||
plot.addGraph(new JKQTPGeoPolyLines(&plot, p, QColor("darkgreen"), 4, Qt::PenStyle::DashDotLine));
|
||||
|
||||
|
||||
// 3.8 some arcs
|
||||
plot.addGraph(new JKQTPGeoText(&plot, 2.1,1.95, "\\textbf{Arcs:}", 14, QColor("red")));
|
||||
plot.addGraph(new JKQTPGeoRectangle(&plot, 2.5,1.5,0.9,0.9, QColor("lightgrey"), 0.5, Qt::SolidLine));
|
||||
plot.addGraph(new JKQTPGeoArc(&plot,2.5,1.5,0.9,0.9, 0, 90 , QColor("blue"), 4, Qt::PenStyle::SolidLine));
|
||||
@ -141,7 +144,7 @@ int main(int argc, char* argv[])
|
||||
plot.addGraph(new JKQTPGeoSymbol(&plot, 2.5,1.5, JKQTPCircle, 5, QColor("grey")));
|
||||
|
||||
|
||||
// 3.8 some pies
|
||||
// 3.9 some pies
|
||||
plot.addGraph(new JKQTPGeoText(&plot, 2.1,2.95, "\\textbf{Pies:}", 14, QColor("red")));
|
||||
plot.addGraph(new JKQTPGeoRectangle(&plot, 2.5,2.5,0.9,0.9, QColor("lightgrey"), 0.5, Qt::SolidLine));
|
||||
JKQTPGeoPie* pie;
|
||||
@ -155,7 +158,7 @@ int main(int argc, char* argv[])
|
||||
plot.addGraph(new JKQTPGeoSymbol(&plot, 2.5,2.5, JKQTPCircle, 5, QColor("grey")));
|
||||
|
||||
|
||||
// 3.9 some chords
|
||||
// 3.10 some chords
|
||||
plot.addGraph(new JKQTPGeoText(&plot, 1.1,2.95, "\\textbf{Chords:}", 14, QColor("red")));
|
||||
plot.addGraph(new JKQTPGeoRectangle(&plot, 1.5,2.5,0.9,0.9, QColor("lightgrey"), 0.5, Qt::SolidLine));
|
||||
JKQTPGeoChord* chord;
|
||||
|
@ -292,6 +292,8 @@ JKQTCOMMON_LIB_EXPORT QVector<QPointF> JKQTPDrawEllipse(double x, double y, doub
|
||||
\param x x-coordinate of position the tooltip points to
|
||||
\param y y-coordinate of position the tooltip points to
|
||||
\param rect rectangle of the main tooltip area
|
||||
|
||||
\image html tooltiptool_example.png
|
||||
*/
|
||||
template <class TPainter>
|
||||
inline void JKQTPDrawTooltip(TPainter& painter, double x, double y, const QRectF& rect);
|
||||
|
@ -426,7 +426,7 @@ inline bool JKQTPIsOKFloat(T v) {
|
||||
/** \brief evaluates a gaussian propability density function
|
||||
* \ingroup jkqtptools_math_basic
|
||||
*
|
||||
* \f[ f(x,\mu, \sigma)=\frac{1}{\sqrt{2\pi\sigma^2}}\cdot\eJKQTPSTATISTICS_PIeft(-\frac{(x-\mu)^2}{2\sigma^2}\right)
|
||||
* \f[ f(x,\mu, \sigma)=\frac{1}{\sqrt{2\pi\sigma^2}}\cdot\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) \f]
|
||||
*/
|
||||
inline double jkqtp_gaussdist(double x, double mu=0.0, double sigma=1.0) {
|
||||
return exp(-0.5*jkqtp_sqr(x-mu)/jkqtp_sqr(sigma))/sqrt(2.0*JKQTPSTATISTICS_PI*sigma*sigma);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 125 KiB |
Binary file not shown.
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 25 KiB |
Loading…
Reference in New Issue
Block a user