Overlay item with basic 2D plotting. More...
Public Types | |
enum | LegendPosition { RIGHT, BELOW } |
Position of the plot legend. More... | |
![]() | |
enum | LayoutCorner { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, CENTER, TOP_CENTER, BOTTOM_CENTER } |
Enumerator for the different locations/"corners" of the view. More... | |
enum | LayoutDirection { HORIZONTAL, VERTICAL, ABSOLUTE_POSITION } |
Enumerator for horizontal or vertical orientation of layout items. Describes which direction additional items should be positioned if more than one exists in the same corner. More... | |
Public Member Functions | |
OverlayPlot (vis::Font *font) | |
Constructs an overlay plot. More... | |
virtual unsigned int | width () const |
Returns the width of the overlay plot in pixels. More... | |
virtual unsigned int | height () const |
Returns the height of the overlay plot in pixels. More... | |
void | setSize (unsigned int width, unsigned int height) |
Sets the size of the text box, in pixels. More... | |
virtual int | priority () const |
Returns the render priority of the item. More... | |
virtual void | setPriority (int priority) |
Sets render priority of the item. More... | |
Str | title () const |
Returns the plot title. More... | |
void | setTitle (const Str &title) |
Sets the plot title. More... | |
bool | drawBackground () const |
Returns true if plot background is drawn. More... | |
void | setDrawBackground (bool drawBackground) |
Specifies if the border should be drawn or not. More... | |
Color3f | backgroundColor () const |
Returns the background color of the overlay plot. More... | |
void | setBackgroundColor (const Color3f &color) |
Sets the background color of the overlay plot. More... | |
float | backgroundOpacity () const |
Returns the opacity of the background. More... | |
void | setBackgroundOpacity (float opacity) |
Sets the opacity (transparency) of the background of the overlay plot. More... | |
Color3f | borderColor () const |
Returns the border color of the overlay plot. More... | |
void | setBorderColor (const Color3f &color) |
Sets the color of the border of the overlay plot. More... | |
float | borderWidth () const |
Returns the width of the border around the overlay plot in pixels. More... | |
void | setBorderWidth (float width) |
Sets the width in pixels of the border around the overlay plot. More... | |
bool | drawBorder () const |
Returns true if the border is drawn. More... | |
void | setDrawBorder (bool drawBorder) |
Specifies if the border should be drawn or not. More... | |
const AxisSettings & | axisSettings () const |
Returns the axis settings for this plot. More... | |
AxisSettings & | axisSettings () |
Returns the axis settings for this plot. More... | |
const MarkerLine & | markerLine () const |
Returns the marker line for this plot. More... | |
MarkerLine & | markerLine () |
Returns the marker line for this plot. More... | |
bool | drawCurveLegend () const |
Returns true if the curve legend is drawn. More... | |
void | setDrawCurveLegend (bool drawCurveLegend) |
Specifies if the curve legend is drawn or not. More... | |
LegendPosition | curveLegendPosition () const |
Returns the curve legend position. More... | |
void | setCurveLegendPosition (LegendPosition position) |
Sets the curve legend position. More... | |
Color3f | textColor () const |
Sets the color used for text (labels and titles) More... | |
void | setTextColor (const Color3f &color) |
Sets the color used for text (labels and titles) More... | |
void | setFont (vis::Font *font) |
Sets the font used by the plot. More... | |
size_t | curveCount () const |
Returns the number of curves in this plot. More... | |
const Curve * | curve (size_t curveIndex) const |
Returns the curve at the specified index. More... | |
Curve * | curve (size_t curveIndex) |
Returns the curve at the specified index. More... | |
Curve * | addCurve (const Str &curveName, const std::vector< double > &xValues, const std::vector< double > &yValues) |
Adds a curve to the plot specifying a name and an x- and y-value array. More... | |
void | removeAllCurves () |
Removes all curves from the plot. More... | |
void | removeCurve (size_t curveIndex) |
Removes the curve at the specified index from the plot. More... | |
double | xValuesMinimum () const |
Returns the minimum x value of all curves in the plot. More... | |
double | xValuesMaximum () const |
Returns the maximum x value of all curves in the plot. More... | |
double | yValuesMinimum () const |
Returns the minimum y value of all curves in the plot. More... | |
double | yValuesMaximum () const |
Returns the maximum y value of all curves in the plot. More... | |
![]() | |
bool | visible () const |
Returns true if the overlay item is set to be visible. More... | |
void | setVisible (bool visible) |
Sets if the overlay item should be visible or not. More... | |
int | absolutePositionX () const |
Returns the x coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION. More... | |
int | absolutePositionY () const |
Returns the y coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION. More... | |
void | setAbsolutePosition (int x, int y) |
Sets the absolute position of the bottom left corner of the OverlayItem as an offset from the LayoutCorner of the item. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
Overlay item with basic 2D plotting.
A view overlay item capable of showing a 2D plot (with optional border and background). The overlay plot can have any number of curves and offers a curve legend and a marker line. Various settings such as range, titles and colors(text, curve, lines, background, ...) can be set.
See the topic 2D plotting
An overlay plot contains one or more curves where each curve is a series of x- and y-values. These values can be saved and read from the VTFx model file. Plot settings, such as which curves are used in which plots, colors, titles and other, are saved as properties. (See PropertyApplierPlot2d and PropertyBuilderPlot2d).
The overlay item can be added to a view using the View::overlay() and Overlay::addItem(). The view manages the layout of the overlay items, so only a desired size can be given in this class. The position is specified when the overlay item is added to the view.
An overlay item can be shown in multiple views at the same time.
The demo apps found in the Ceetron Desktop Components distribution offers example code for import, export and usage of plot data and overlay plots.
cee::plt::OverlayPlot::OverlayPlot | ( | vis::Font * | font | ) |
Constructs an overlay plot.
Curve * cee::plt::OverlayPlot::addCurve | ( | const Str & | curveName, |
const std::vector< double > & | xValues, | ||
const std::vector< double > & | yValues | ||
) |
Adds a curve to the plot specifying a name and an x- and y-value array.
const AxisSettings & cee::plt::OverlayPlot::axisSettings | ( | ) | const |
Returns the axis settings for this plot.
AxisSettings & cee::plt::OverlayPlot::axisSettings | ( | ) |
Returns the axis settings for this plot.
cee::Color3f cee::plt::OverlayPlot::backgroundColor | ( | ) | const |
Returns the background color of the overlay plot.
float cee::plt::OverlayPlot::backgroundOpacity | ( | ) | const |
Returns the opacity of the background.
1.0 = opaque, 0.0 = fully transparent
cee::Color3f cee::plt::OverlayPlot::borderColor | ( | ) | const |
Returns the border color of the overlay plot.
float cee::plt::OverlayPlot::borderWidth | ( | ) | const |
Returns the width of the border around the overlay plot in pixels.
const Curve * cee::plt::OverlayPlot::curve | ( | size_t | curveIndex | ) | const |
Returns the curve at the specified index.
Curve * cee::plt::OverlayPlot::curve | ( | size_t | curveIndex | ) |
Returns the curve at the specified index.
size_t cee::plt::OverlayPlot::curveCount | ( | ) | const |
Returns the number of curves in this plot.
cee::plt::OverlayPlot::LegendPosition cee::plt::OverlayPlot::curveLegendPosition | ( | ) | const |
Returns the curve legend position.
bool cee::plt::OverlayPlot::drawBackground | ( | ) | const |
Returns true if plot background is drawn.
bool cee::plt::OverlayPlot::drawBorder | ( | ) | const |
Returns true if the border is drawn.
bool cee::plt::OverlayPlot::drawCurveLegend | ( | ) | const |
Returns true if the curve legend is drawn.
|
virtual |
Returns the height of the overlay plot in pixels.
Implements cee::vis::OverlayItem.
const MarkerLine & cee::plt::OverlayPlot::markerLine | ( | ) | const |
Returns the marker line for this plot.
MarkerLine & cee::plt::OverlayPlot::markerLine | ( | ) |
Returns the marker line for this plot.
|
virtual |
Returns the render priority of the item.
Implements cee::vis::OverlayItem.
void cee::plt::OverlayPlot::removeAllCurves | ( | ) |
Removes all curves from the plot.
void cee::plt::OverlayPlot::removeCurve | ( | size_t | curveIndex | ) |
Removes the curve at the specified index from the plot.
void cee::plt::OverlayPlot::setBackgroundColor | ( | const Color3f & | color | ) |
Sets the background color of the overlay plot.
void cee::plt::OverlayPlot::setBackgroundOpacity | ( | float | opacity | ) |
Sets the opacity (transparency) of the background of the overlay plot.
1.0 = opaque, 0.0 = fully transparent
void cee::plt::OverlayPlot::setBorderColor | ( | const Color3f & | color | ) |
Sets the color of the border of the overlay plot.
void cee::plt::OverlayPlot::setBorderWidth | ( | float | width | ) |
Sets the width in pixels of the border around the overlay plot.
void cee::plt::OverlayPlot::setCurveLegendPosition | ( | LegendPosition | position | ) |
Sets the curve legend position.
void cee::plt::OverlayPlot::setDrawBackground | ( | bool | drawBackground | ) |
Specifies if the border should be drawn or not.
void cee::plt::OverlayPlot::setDrawBorder | ( | bool | drawBorder | ) |
Specifies if the border should be drawn or not.
void cee::plt::OverlayPlot::setDrawCurveLegend | ( | bool | drawCurveLegend | ) |
Specifies if the curve legend is drawn or not.
void cee::plt::OverlayPlot::setFont | ( | vis::Font * | font | ) |
Sets the font used by the plot.
|
virtual |
Sets render priority of the item.
The render priority determines the order in which item get rendered. Items with lower priorities get rendered first. The default priority is 18.
Implements cee::vis::OverlayItem.
|
virtual |
Sets the size of the text box, in pixels.
Implements cee::vis::OverlayItem.
void cee::plt::OverlayPlot::setTextColor | ( | const Color3f & | color | ) |
Sets the color used for text (labels and titles)
void cee::plt::OverlayPlot::setTitle | ( | const Str & | title | ) |
Sets the plot title.
cee::Color3f cee::plt::OverlayPlot::textColor | ( | ) | const |
Sets the color used for text (labels and titles)
cee::Str cee::plt::OverlayPlot::title | ( | ) | const |
Returns the plot title.
|
virtual |
Returns the width of the overlay plot in pixels.
Implements cee::vis::OverlayItem.
double cee::plt::OverlayPlot::xValuesMaximum | ( | ) | const |
Returns the maximum x value of all curves in the plot.
double cee::plt::OverlayPlot::xValuesMinimum | ( | ) | const |
Returns the minimum x value of all curves in the plot.
double cee::plt::OverlayPlot::yValuesMaximum | ( | ) | const |
Returns the maximum y value of all curves in the plot.
double cee::plt::OverlayPlot::yValuesMinimum | ( | ) | const |
Returns the minimum y value of all curves in the plot.