Wt  3.3.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions
Wt::Chart::WScatterData Class Reference

Class representing a collection of points for on a 3D chart. More...

Inheritance diagram for Wt::Chart::WScatterData:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 WScatterData (WAbstractItemModel *model)
 Constructor.
void setDroplinesEnabled (bool enable=true)
 Enables or disables droplines for all points.
bool droplinesEnabled () const
 Returns whether droplines are enabled.
void setDroplinesPen (const WPen &pen)
 Sets the pen that is used to draw droplines.
WPen droplinesPen () const
 Returns the pen that is used to draw droplines.
void setXSeriesColumn (int columnNumber)
 Sets the column-index from the model that is used for the x-coordinate of all points.
int XSeriesColumn () const
 Returns the column-index from the model that is used for the x-coordinate of all points.
void setYSeriesColumn (int columnNumber)
 Sets the column-index from the model that is used for the y-coordinate of all points.
int YSeriesColumn () const
 Returns the column-index from the model that is used for the y-coordinate of all points.
void setZSeriesColumn (int columnNumber)
 Sets the column-index from the model that is used for the z-coordinate of all points.
int ZSeriesColumn () const
 Returns the column-index from the model that is used for the z-coordinate of all points.
void setColorColumn (int columnNumber, ItemDataRole role=DisplayRole)
 Configure a column in the model to be used for the color of the points.
void setSizeColumn (int columnNumber, ItemDataRole role=DisplayRole)
 Configure a column in the model to be used for the size of the points.
std::vector< WPointSelectionpickPoints (int x, int y, int radius) const
 Pick points on this WScatterData using a single pixel.
std::vector< WPointSelectionpickPoints (int x1, int y1, int x2, int y2) const
 Pick points on this WScatterData inside of a rectangle.
virtual double minimum (Axis axis) const
 Returns the computed minimum value of this dataseries along the given axis.
virtual double maximum (Axis axis) const
 Returns the computed maximum value of this dataseries along the given axis.
virtual void initializeGL ()
 Initialize GL resources.
virtual void paintGL () const
 Update the client-side painting function.
virtual void updateGL ()
 Update GL resources.
virtual void resizeGL ()
 Act on resize events.
virtual void deleteAllGLResources ()
 Delete GL resources.

Detailed Description

Class representing a collection of points for on a 3D chart.

General information can be found at WAbstractDataSeries3D. The model should be structured as a table where every row represents a point. In the simplest case, there are three columns representing the x-, y- and z-values. By default, this is column 0 for X, column 1 for Y and column 2 for Z. It is also possible to provide an additional column containing information on the color for each point. The same is possible for the size. Color-information in the model should be present as a WColor.

If these extra columns are not included, the MarkerBrushColorRole and MarkerScaleFactorRole can still be used to style individual points. These dataroles should be set on the values in the column containing the z-values.

The figure below shows an upward spiral of points, with droplines enabled and a pointsize of 5 pixels.

spiral.png
An example of WScatterData

Member Function Documentation

Delete GL resources.

This function is called by updateGL() in the chart to which this dataseries was added.

Implements Wt::Chart::WAbstractDataSeries3D.

Returns whether droplines are enabled.

See also:
setDroplinesEnabled(), setDroplinesPen()

Returns the pen that is used to draw droplines.

See also:
setDroplinesEnabled(), setDroplinesPen()
virtual void Wt::Chart::WScatterData::initializeGL ( ) [virtual]

Initialize GL resources.

This function is called by initializeGL() in the chart to which this dataseries was added.

Implements Wt::Chart::WAbstractDataSeries3D.

double Wt::Chart::WScatterData::maximum ( Axis  axis) const [virtual]

Returns the computed maximum value of this dataseries along the given axis.

See also:
minimum()

Implements Wt::Chart::WAbstractDataSeries3D.

double Wt::Chart::WScatterData::minimum ( Axis  axis) const [virtual]

Returns the computed minimum value of this dataseries along the given axis.

See also:
maximum()

Implements Wt::Chart::WAbstractDataSeries3D.

void Wt::Chart::WScatterData::paintGL ( ) const [virtual]

Update the client-side painting function.

This function is called by paintGL() in the chart to which this dataseries was added.

Implements Wt::Chart::WAbstractDataSeries3D.

std::vector< WPointSelection > Wt::Chart::WScatterData::pickPoints ( int  x,
int  y,
int  radius 
) const

Pick points on this WScatterData using a single pixel.

x,y are the screen coordinates of the pixel from the top left of the chart, and radius is the radius in pixels around that pixel. All points around the ray projected through the pixel within the given radius will be returned.

std::vector< WPointSelection > Wt::Chart::WScatterData::pickPoints ( int  x1,
int  y1,
int  x2,
int  y2 
) const

Pick points on this WScatterData inside of a rectangle.

The screen coordinates (x1, y1) and (x2, y2) from the top left of the chart define a rectangle within which the points should be selected.

Act on resize events.

This function is called by resizeGL() in the chart to which this dataseries was added.

Implements Wt::Chart::WAbstractDataSeries3D.

void Wt::Chart::WScatterData::setColorColumn ( int  columnNumber,
ItemDataRole  role = DisplayRole 
)

Configure a column in the model to be used for the color of the points.

By default, the color-column is set to -1. This means there is no column which specifies color-values. Also, the basic mechanism of using the MarkerBrushColorRole (if present) is then active. The Z-seriescolumn is checked for the presence of this Role.

/sa setZSeriesColumn()

void Wt::Chart::WScatterData::setDroplinesEnabled ( bool  enable = true)

Enables or disables droplines for all points.

Enabling droplines will cause a line to be drawn from every point to the the ground-plane of the chart's plotcube. By default the droplines are disabled.

See also:
setDroplinesPen()

Sets the pen that is used to draw droplines.

The default pen is a default constructed WPen.

Note: only the width and color of the pen are used.

See also:
setDroplinesEnabled()
void Wt::Chart::WScatterData::setSizeColumn ( int  columnNumber,
ItemDataRole  role = DisplayRole 
)

Configure a column in the model to be used for the size of the points.

By default, the size-column is set to -1. This means there is no column which specifies size-values. Also, the basic mechanism of using the MarkerScaleFactorRole (if present) is then active. The Z-seriescolumn is checked for the presence of this Role.

/sa setZSeriesColumn()

void Wt::Chart::WScatterData::setXSeriesColumn ( int  columnNumber)

Sets the column-index from the model that is used for the x-coordinate of all points.

The default X column index is 0.

void Wt::Chart::WScatterData::setYSeriesColumn ( int  columnNumber)

Sets the column-index from the model that is used for the y-coordinate of all points.

The default X column index is 1.

void Wt::Chart::WScatterData::setZSeriesColumn ( int  columnNumber)

Sets the column-index from the model that is used for the z-coordinate of all points.

The default Z column index is 2.

Note that this column is also used to check for a MarkerBrushColorRole and a MarkerScaleFactorRole is no color-column or size-column are set.

See also:
setColorColumn(), setSizeColumn()

Update GL resources.

This function is called by updateGL() in the chart to which this dataseries was added. Before this function is called, deleteAllGLResources() is called.

See also:
deleteAllGLResources()

Implements Wt::Chart::WAbstractDataSeries3D.

Returns the column-index from the model that is used for the x-coordinate of all points.

See also:
setXSeriesColumn()

Returns the column-index from the model that is used for the y-coordinate of all points.

See also:
setYSeriesColumn()

Returns the column-index from the model that is used for the z-coordinate of all points.

See also:
setZSeriesColumn()
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1