Wt  3.3.9
Public Member Functions | List of all members
Wt::Chart::WAbstractDataSeries3D Class Referenceabstract

Abstract base class for dataseries that can be drawn on a WCartesian3DChart. More...

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

Public Member Functions

 WAbstractDataSeries3D (WAbstractItemModel *model)
 Constructor. More...
 
void setTitle (const WString &name)
 Sets the title of this dataseries. More...
 
const WStringtitle () const
 Returns the title of this dataseries. More...
 
void setModel (WAbstractItemModel *model)
 Sets a model from which the dataseries gets its data. More...
 
WAbstractItemModelmodel () const
 Returns a pointer to the model used by this dataseries. More...
 
virtual double minimum (Axis axis) const =0
 Returns the computed minimum value of this dataseries along the given axis. More...
 
virtual double maximum (Axis axis) const =0
 Returns the computed maximum value of this dataseries along the given axis. More...
 
const WCartesian3DChartchart () const
 Returns a const pointer to the WCartesian3DChart on which the dataseries is drawn.
 
void setPointSize (double size)
 Sets the pointsize for drawing this dataseries. More...
 
double pointSize () const
 Returns the pointsize for drawing this dataseries. More...
 
void setPointSprite (const std::string &image)
 Set the point sprite used for drawing this dataseries. More...
 
const std::string & pointSprite () const
 Returns the point sprite used for drawing this dataseries. More...
 
void setColorMap (WAbstractColorMap *colormap)
 Sets the colormap for this dataseries. More...
 
const WAbstractColorMapcolorMap () const
 Returns the colormap used by this dataseries. More...
 
void setColorMapVisible (bool enabled=true)
 Sets whether the colormap that is used should be shown alongside the chart in the form of a legend. More...
 
bool colorMapVisible () const
 Returns whether the colormap is shown alongside the chart in the form of a legend. More...
 
void setColorMapSide (Side side)
 Sets whether the colormap is shown on the left or right. More...
 
Side colorMapSide () const
 Returns on which side the colormap is shown. More...
 
void setLegendEnabled (bool enabled=true)
 Sets whether this dataseries is included in the chart-legend. More...
 
bool isLegendEnabled () const
 Returns whether this dataseries is included in the chart-legend. More...
 
void setHidden (bool enabled=true)
 Sets if this dataseries is hidden. More...
 
bool isHidden () const
 Returns if this dataseries is hidden. More...
 
virtual void initializeGL ()=0
 Initialize GL resources. More...
 
virtual void paintGL () const =0
 Update the client-side painting function. More...
 
virtual void updateGL ()=0
 Update GL resources. More...
 
virtual void resizeGL ()=0
 Act on resize events. More...
 
virtual void deleteAllGLResources ()=0
 Delete GL resources. More...
 
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 Create a WObject with a given parent object. More...
 
virtual ~WObject ()
 Destructor. More...
 
virtual const std::string id () const
 Returns the (unique) identifier for this object. More...
 
virtual void setObjectName (const std::string &name)
 Sets an object name. More...
 
virtual std::string objectName () const
 Returns the object name. More...
 
void resetLearnedSlots ()
 Resets learned stateless slot implementations. More...
 
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance. More...
 
void isNotStateless ()
 Marks the current function as not stateless. More...
 
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method. More...
 
void addChild (WObject *child)
 Adds a child object. More...
 
virtual void removeChild (WObject *child)
 Removes a child object. More...
 
const std::vector< WObject * > & children () const
 Returns the children.
 
WObjectparent () const
 Returns the parent object.
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation. More...
 
- Static Protected Member Functions inherited from Wt::WObject
static WObjectsender ()
 Returns the sender of the current slot call. More...
 

Detailed Description

Abstract base class for dataseries that can be drawn on a WCartesian3DChart.

General

The model that is provided at construction or with setModel() contains the data of a dataseries. Implementations of this class format the data for representation on the chart and perform all necessary drawing operations. Note that if a dataseries holds numerical data it should be added to a chart of type ScatterPlot, if it holds categorical data it should be added to a chart of type CategoryChart.

Color

The color used to draw data on a chart can be specified in a number of ways. The priority of this is as follows (1 being the highest):

  1. MarkerBrushColorRole set on a value in the model
  2. WAbstractColorMap set on the dataseries
  3. WChartPalette present in the chart

A chart-palette will specify one color for the entire dataseries. Each new dataseries on a chart will receive another color.
A colormap assigns different colors to the data within one dataseries, based on the z-value of the data. WStandardColorMap provides an easy way to create a colormap that is either smooth or consists of a number of bands.

Data-roles

The roles on the model which are taken into account are:

Some representations of the data ignore these roles. For example, when a surface is drawn, the roles are ignored.

Implementing a new dataseries class

When the existing implementations of WAbstractDataSeries3D don't meet your needs, you might want to make your own. When doing this there are some details of the chart that you should know. The chart is made so that when a property of the chart changes, which affect any of the GL resources, all GL resources are destroyed and re-initialized. This eliminates the need to determine which chart-setting affect which GL-resources, which can be a complicated problem.

Therefore only unchanging GL resources are initialized in initializeGL(). The initializeGL function in the chart is implemented to immediately request a call to updateGL(), which then initializes the rest of the GL resources. Every call to updateGL in the chart, will first call deleteAllGLResources() on all dataseries and will then call updateGL() on all dataseries. So, when implementing a dataseries: initialize unchanging GL resources in initializeGL(), initialize the rest of your GL resources in updateGL() and make GL-delete calls to all resources initialized in updateGL() in the function deleteAllGLResources(). It is also best to check isNull() on each of your GL-resources when deleting them.

Constructor & Destructor Documentation

Wt::Chart::WAbstractDataSeries3D::WAbstractDataSeries3D ( WAbstractItemModel model)

Constructor.

This constructor takes a WAbstractItemModel as an argument. The model contains the data of this dataseries. How the model should be structured is dependent on the implementation. Therefore this information is found in the documentation of classes deriving from this one.

Member Function Documentation

const WAbstractColorMap* Wt::Chart::WAbstractDataSeries3D::colorMap ( ) const

Returns the colormap used by this dataseries.

If this dataseries has no colormap set, 0 will be returned.

See also
setColorMap(), setColorMapVisible(), setColorMapSide()
Side Wt::Chart::WAbstractDataSeries3D::colorMapSide ( ) const

Returns on which side the colormap is shown.

See also
setColorMap, setColorMapVisible(), setColorMapSide()
bool Wt::Chart::WAbstractDataSeries3D::colorMapVisible ( ) const

Returns whether the colormap is shown alongside the chart in the form of a legend.

See also
setColorMap(), setColorMapVisible(), setColorMapSide()
virtual void Wt::Chart::WAbstractDataSeries3D::deleteAllGLResources ( )
pure virtual

Delete GL resources.

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

Implemented in Wt::Chart::WAbstractGridData, and Wt::Chart::WScatterData.

virtual void Wt::Chart::WAbstractDataSeries3D::initializeGL ( )
pure virtual

Initialize GL resources.

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

Implemented in Wt::Chart::WAbstractGridData, and Wt::Chart::WScatterData.

bool Wt::Chart::WAbstractDataSeries3D::isHidden ( ) const

Returns if this dataseries is hidden.

See also
setHidden()
bool Wt::Chart::WAbstractDataSeries3D::isLegendEnabled ( ) const

Returns whether this dataseries is included in the chart-legend.

See also
setLegendEnabled()
virtual double Wt::Chart::WAbstractDataSeries3D::maximum ( Axis  axis) const
pure virtual

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

See also
minimum()

Implemented in Wt::Chart::WScatterData, Wt::Chart::WAbstractGridData, Wt::Chart::WGridData, and Wt::Chart::WEquidistantGridData.

virtual double Wt::Chart::WAbstractDataSeries3D::minimum ( Axis  axis) const
pure virtual

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

See also
maximum()

Implemented in Wt::Chart::WScatterData, Wt::Chart::WAbstractGridData, Wt::Chart::WGridData, and Wt::Chart::WEquidistantGridData.

WAbstractItemModel* Wt::Chart::WAbstractDataSeries3D::model ( ) const

Returns a pointer to the model used by this dataseries.

See also
setModel()
virtual void Wt::Chart::WAbstractDataSeries3D::paintGL ( ) const
pure virtual

Update the client-side painting function.

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

Implemented in Wt::Chart::WAbstractGridData, and Wt::Chart::WScatterData.

double Wt::Chart::WAbstractDataSeries3D::pointSize ( ) const

Returns the pointsize for drawing this dataseries.

See also
setPointSize()
const std::string& Wt::Chart::WAbstractDataSeries3D::pointSprite ( ) const

Returns the point sprite used for drawing this dataseries.

See also
setPointSprite()
virtual void Wt::Chart::WAbstractDataSeries3D::resizeGL ( )
pure virtual

Act on resize events.

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

Implemented in Wt::Chart::WAbstractGridData, and Wt::Chart::WScatterData.

void Wt::Chart::WAbstractDataSeries3D::setColorMap ( WAbstractColorMap colormap)

Sets the colormap for this dataseries.

Ownership of the WAbstractColorMap is transferred to this class.

By default there is no colormap set. When a colormap is set on a dataseries, the color of WCartesian3DChart::palette() is no longer used for this series. The colormap associates a color to the data based on the z-value of the data. If the colormap is set to 0, the value of the palette will be used again.

If the colormap has no parent yet, then ownership is transferred to this WAbstractDataSeries3D, and thus the validator will be deleted together with the WAbstractDataSeries3D.

See also
setColorMapVisible(), setColorMapSide()
void Wt::Chart::WAbstractDataSeries3D::setColorMapSide ( Side  side)

Sets whether the colormap is shown on the left or right.

The default side is Right.

Note: only Left and Right are valid values for this function.

See also
setColorMap(), setColorMapVisible()
void Wt::Chart::WAbstractDataSeries3D::setColorMapVisible ( bool  enabled = true)

Sets whether the colormap that is used should be shown alongside the chart in the form of a legend.

The default value is false.

See also
setColorMap(), setColorMapSide()
void Wt::Chart::WAbstractDataSeries3D::setHidden ( bool  enabled = true)

Sets if this dataseries is hidden.

By default dataseries are visible.

void Wt::Chart::WAbstractDataSeries3D::setLegendEnabled ( bool  enabled = true)

Sets whether this dataseries is included in the chart-legend.

By default, dataseries are enabled in the legend.

void Wt::Chart::WAbstractDataSeries3D::setModel ( WAbstractItemModel model)

Sets a model from which the dataseries gets its data.

Every dataseries needs a model from which it gets the data. How the data is structured is determined by the type of dataseries. Therefore more info on how to construct a proper model is provided in classes that derive from this one.

See also
model(), WAbstractDataSeries3D()
void Wt::Chart::WAbstractDataSeries3D::setPointSize ( double  size)

Sets the pointsize for drawing this dataseries.

The default pointsize is 2 pixels.

Note: Setting the point-size is currently not supported in IE.

void Wt::Chart::WAbstractDataSeries3D::setPointSprite ( const std::string &  image)

Set the point sprite used for drawing this dataseries.

This should be a local (server side) path to an image, such as a PNG or GIF. Only the alpha channel of this image is used: the sprite only decides if a pixel in the point appears or not. If the alpha value is below 0.5, the pixel is discarded.

For best effect, the point sprite's width and height should be the same as the pointSize(), and the chart's antialiasing should be disabled.

Defaults to the empty string, meaning that every pixel of the point will be drawn, yielding a square.

void Wt::Chart::WAbstractDataSeries3D::setTitle ( const WString name)

Sets the title of this dataseries.

When a dataseries that did not have a title set, is added to a WCartesian3DChart it automatically gets the default title 'dataset i', with i the count of how many dataseries have been added to the chart.

See also
name()
const WString& Wt::Chart::WAbstractDataSeries3D::title ( ) const

Returns the title of this dataseries.

See also
setName()
virtual void Wt::Chart::WAbstractDataSeries3D::updateGL ( )
pure virtual

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()

Implemented in Wt::Chart::WAbstractGridData, and Wt::Chart::WScatterData.


Generated on Tue Nov 21 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11