JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
|
This project shows the capabilities of JKQTPlotter to also draw arrows as geometric elements, using JKQTPGeoArrow. The arrow head/tail are defined by the enum values in JKQTPLineDecoratorStyle.
The source code of the main application can be found in geo_arrows.cpp
. First a plot is generated. Then several types of arrows are plotted onto the JKQtPlotter.
A first table shows all available arrow tips in different sizes.
Here is the resulting table:
Note how the head-size scales with the line-width, but not linearly, but rather sub-linearly, so the tips do not grow too strongly.
Also note that all arrows end at the designated line-end (here indicated by dashed grey lines), even circles and rectangle:
You can use JKQTPGeoArrow and JKQTPGeoLine to draw arrows (JKQTPGeoArrow is just a convenience class that enables arrows by default, otherwise it is equal to JKQTPGeoLine).
In addition, also other classes can show line-decorators:
Here is an example of how to actiavate them for a JKQTPGeoPolyLines:
Here is the result:
For the class JKQTPGeoInfiniteLine the start can be decorated with an arrow (only if two_sided==false!):
Here is the result:
The result of the complete example looks like this: