All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
te::qt::widgets::Scatter Class Reference

A class to represent a scatter. More...

#include <Scatter.h>

Public Member Functions

void addData (double &xValue, double &yValue, te::da::ObjectId *oid)
 It adds the x and Y axis values to the scatter's vectors and the associeted objectId to the scatter's multi_index container. More...
 
void addX (double &xValue)
 It adds a new value to the vector containing the X axis values. More...
 
void addY (double &yValue)
 It adds a new value to the vector containing the Y axis values. More...
 
void calculateMinMaxValues ()
 Calculates the minimum and maximum values for both the X and Y axis. More...
 
te::da::ObjectIdSetfind (double &xValue, double &yValue)
 It returns a pointer to an ObjectIdSet that contains all of the scatter's selected points. More...
 
te::da::ObjectIdSetfind (std::vector< QPointF > selectedPoints)
 It returns a pointer to an ObjectIdSet that contains all of the scatter's selected points. More...
 
const std::pair< double, double > find (const te::da::ObjectId *oid)
 It returns a pair representing the point that contais the secected ObjectId. More...
 
double getMaxX ()
 It returns the maximum value of the X axis. More...
 
double getMaxY ()
 It returns the maximum value of the Y axis. More...
 
double getMinX ()
 It returns the minimum value of the X axis. More...
 
double getMinY ()
 It returns the minimum value of the Y axis. More...
 
double getX (unsigned int idx)
 It returns the idx-th value of the scatter X axis, as a double. More...
 
double * getX ()
 It returns a pointer to the first value of the scatter X axis. More...
 
double getY (unsigned int idx)
 It returns the idx-th value of the scatter Y axis, as a double. More...
 
double * getY ()
 It returns a pointer to the first value of the scatter Y axis. More...
 
 Scatter (const std::vector< double > &axisX, const std::vector< double > &axisY)
 Constructor. More...
 
 Scatter ()
 Constructor. More...
 
void setMaxX (double &new_maxX)
 It sets the maximum value of the X axis. More...
 
void setMaxY (double &maxY)
 It sets the maximum value of the Y axis. More...
 
void setMinX (double &new_minX)
 It sets the minimum value of the X axis. More...
 
void setMinY (double &new_minY)
 It sets the minimum value of the Y axis. More...
 
std::size_t sizeX ()
 It returns the size of the scatter. More...
 
std::size_t sizeY ()
 It returns the size of the scatter. More...
 
 ~Scatter ()
 Destructor. More...
 

Private Attributes

double m_maxX
 The maximum value of the x Axis. More...
 
double m_maxY
 The maximum value of the y Axis. More...
 
double m_minX
 The minimum value of the x Axis. More...
 
double m_minY
 The minimum value of the y Axis. More...
 
PointToObjectIdSet m_valuesOids
 The intervals and ObjecIds ordered in a boost multi index container. More...
 
std::vector< double > m_xValues
 Double values for axis X. More...
 
std::vector< double > m_yValues
 Double values for axis Y. More...
 

Detailed Description

A class to represent a scatter.

A widget used to adjust a scatter's input data.

Definition at line 51 of file Scatter.h.

Constructor & Destructor Documentation

te::qt::widgets::Scatter::Scatter ( const std::vector< double > &  axisX,
const std::vector< double > &  axisY 
)

Constructor.

Definition at line 33 of file Scatter.cpp.

References calculateMinMaxValues().

te::qt::widgets::Scatter::Scatter ( )

Constructor.

Definition at line 40 of file Scatter.cpp.

te::qt::widgets::Scatter::~Scatter ( )

Destructor.

Definition at line 48 of file Scatter.cpp.

Member Function Documentation

void te::qt::widgets::Scatter::addData ( double &  xValue,
double &  yValue,
te::da::ObjectId oid 
)

It adds the x and Y axis values to the scatter's vectors and the associeted objectId to the scatter's multi_index container.

Parameters
xValueThe new x axis value to be added to the vector.
yValueThe new y axis value to be added to the vector.
oidThe ObjectId that will be added to the container
Note
it will take ownership of the given ObjectId pointer

Definition at line 156 of file Scatter.cpp.

Referenced by te::qt::widgets::createScatter().

void te::qt::widgets::Scatter::addX ( double &  xValue)

It adds a new value to the vector containing the X axis values.

Parameters
xValueThe new value to be added to the vector.

Definition at line 146 of file Scatter.cpp.

Referenced by te::qt::widgets::createScatter().

void te::qt::widgets::Scatter::addY ( double &  yValue)

It adds a new value to the vector containing the Y axis values.

Parameters
yValueThe new value to be added to the vector.

Definition at line 151 of file Scatter.cpp.

Referenced by te::qt::widgets::createScatter().

void te::qt::widgets::Scatter::calculateMinMaxValues ( )

Calculates the minimum and maximum values for both the X and Y axis.

Definition at line 53 of file Scatter.cpp.

Referenced by te::qt::widgets::createScatter(), and Scatter().

te::da::ObjectIdSet * te::qt::widgets::Scatter::find ( double &  xValue,
double &  yValue 
)

It returns a pointer to an ObjectIdSet that contains all of the scatter's selected points.

Parameters
xValueThe x axis value to be searched.
yValueThe x axis value to be searched.
Note
The caller will take ownership of the returned pointer

Definition at line 163 of file Scatter.cpp.

References te::da::ObjectIdSet::add(), and te::da::ObjectId::addValue().

te::da::ObjectIdSet * te::qt::widgets::Scatter::find ( std::vector< QPointF >  selectedPoints)

It returns a pointer to an ObjectIdSet that contains all of the scatter's selected points.

Parameters
selectedPointsA vector containing all the points within the selection box
Note
The caller will take ownership of the returned pointer

Definition at line 193 of file Scatter.cpp.

References te::da::ObjectIdSet::add(), and te::da::ObjectId::addValue().

const std::pair< double, double > te::qt::widgets::Scatter::find ( const te::da::ObjectId oid)

It returns a pair representing the point that contais the secected ObjectId.

Parameters
oidThe ObjectId to be searched.

Definition at line 231 of file Scatter.cpp.

References te::da::ObjectId::getValueAsString().

double te::qt::widgets::Scatter::getMaxX ( )

It returns the maximum value of the X axis.

Returns
The maximum value of the X axis.
Note
The caller will not have the ownership of the returned pointer.

Definition at line 111 of file Scatter.cpp.

double te::qt::widgets::Scatter::getMaxY ( )

It returns the maximum value of the Y axis.

Returns
The maximum value of the Y axis.
Note
The caller will not have the ownership of the returned pointer.

Definition at line 121 of file Scatter.cpp.

double te::qt::widgets::Scatter::getMinX ( )

It returns the minimum value of the X axis.

Returns
The minimum value of the X axis.
Note
The caller will not have the ownership of the returned pointer.

Definition at line 106 of file Scatter.cpp.

double te::qt::widgets::Scatter::getMinY ( )

It returns the minimum value of the Y axis.

Returns
The minimum value of the Y axis.
Note
The caller will not have the ownership of the returned pointer.

Definition at line 116 of file Scatter.cpp.

double te::qt::widgets::Scatter::getX ( unsigned int  idx)

It returns the idx-th value of the scatter X axis, as a double.

Parameters
idxThe index of the element.
Returns
The idx-th value of the scatter X axis, as a double.

Definition at line 86 of file Scatter.cpp.

double * te::qt::widgets::Scatter::getX ( )

It returns a pointer to the first value of the scatter X axis.

Returns
A pointer to the first value of the scatter X axis.
Note
The caller will not take the ownership of the returned pointer.

Definition at line 91 of file Scatter.cpp.

double te::qt::widgets::Scatter::getY ( unsigned int  idx)

It returns the idx-th value of the scatter Y axis, as a double.

Parameters
idxThe index of the element.
Returns
The idx-th value of the scatter Y axis, as a double.

Definition at line 96 of file Scatter.cpp.

double * te::qt::widgets::Scatter::getY ( )

It returns a pointer to the first value of the scatter Y axis.

Returns
A pointer to the first value of the scatter Y axis.
Note
The caller will not take the ownership of the returned pointer.

Definition at line 101 of file Scatter.cpp.

void te::qt::widgets::Scatter::setMaxX ( double &  new_maxX)

It sets the maximum value of the X axis.

Definition at line 131 of file Scatter.cpp.

void te::qt::widgets::Scatter::setMaxY ( double &  maxY)

It sets the maximum value of the Y axis.

Definition at line 141 of file Scatter.cpp.

void te::qt::widgets::Scatter::setMinX ( double &  new_minX)

It sets the minimum value of the X axis.

Definition at line 126 of file Scatter.cpp.

void te::qt::widgets::Scatter::setMinY ( double &  new_minY)

It sets the minimum value of the Y axis.

Definition at line 136 of file Scatter.cpp.

std::size_t te::qt::widgets::Scatter::sizeX ( )

It returns the size of the scatter.

Returns
The number of the scatter elements on the X axis.

Definition at line 76 of file Scatter.cpp.

Referenced by te::qt::widgets::ScatterChart::ScatterChart().

std::size_t te::qt::widgets::Scatter::sizeY ( )

It returns the size of the scatter.

Returns
The number of the scatter elements on the Y axis.

Definition at line 81 of file Scatter.cpp.

Referenced by te::qt::widgets::ScatterChart::ScatterChart().

Member Data Documentation

double te::qt::widgets::Scatter::m_maxX
private

The maximum value of the x Axis.

Definition at line 239 of file Scatter.h.

double te::qt::widgets::Scatter::m_maxY
private

The maximum value of the y Axis.

Definition at line 241 of file Scatter.h.

double te::qt::widgets::Scatter::m_minX
private

The minimum value of the x Axis.

Definition at line 238 of file Scatter.h.

double te::qt::widgets::Scatter::m_minY
private

The minimum value of the y Axis.

Definition at line 240 of file Scatter.h.

PointToObjectIdSet te::qt::widgets::Scatter::m_valuesOids
private

The intervals and ObjecIds ordered in a boost multi index container.

Definition at line 234 of file Scatter.h.

std::vector<double> te::qt::widgets::Scatter::m_xValues
private

Double values for axis X.

Definition at line 235 of file Scatter.h.

std::vector<double> te::qt::widgets::Scatter::m_yValues
private

Double values for axis Y.

Definition at line 236 of file Scatter.h.


The documentation for this class was generated from the following files: