te::qt::widgets::Histogram Class Reference

A class to represent a Histogram. More...

#include <Histogram.h>

Public Member Functions

void adjustOids (te::dt::AbstractData *interval, std::vector< te::da::ObjectId * > valuesOIds)
 It will populate the IntervalToObjectIdSet with the given interval and it's matching objectIds. More...
 
void clear ()
 A function used to clear the contents of the histogram, deleting the pointers contained by the boost containers used to store the histogram's data. More...
 
te::da::ObjectIdSetfind (te::dt::AbstractData *interval)
 It returns an ObjectIdSet containing all the object Ids associeted with the given interval. More...
 
te::da::ObjectIdSetfind (std::vector< te::dt::AbstractData * > intervals)
 It returns an ObjectIdSet containing all the object Ids associeted with the given interval list. More...
 
const te::dt::AbstractDatafind (const te::da::ObjectId *oid)
 It returns an AbstractData representing the interval that contains the given ObjectId. More...
 
double & getInterval ()
 It returns the histogram's interval. Will be invalid if the histogram was created based on string intervals. More...
 
double & getMinValue ()
 It returns the histogram's minimum value. Will be invalid if the histogram was created based on string intervals. More...
 
std::set< std::string > & getStringInterval ()
 It returns the histogram's string set of intervals. Will be invalid if the histogram was created based on numeric (double, float, etc) intervals. More...
 
std::map< std::string, unsigned int > getStringValues ()
 It returns the map containing the histogram String values. The key is a unique string that represents an interval and the unsigned int is the frequency of that interval. More...
 
int & getType ()
 It returns the histogram's type. More...
 
std::map< double, unsigned int > getValues ()
 It returns the map containing the histogram values. The key is the minimum values of the histogram's interval, and the unsigned int is the frequency of that interval. More...
 
 Histogram ()
 Constructor. More...
 
void insert (std::pair< te::dt::AbstractData *, unsigned int > new_value, std::vector< te::da::ObjectId * > valuesOIds)
 It adds a new value to the map containing the histogram values. More...
 
void insert (std::pair< te::dt::AbstractData *, unsigned int > new_value)
 It adds a new value to the map containing the histogram values. The AbstractData represents the interval and the unsigned int represents that interval's frequency. More...
 
void insert (te::dt::AbstractData *interval, unsigned int frequency, std::vector< te::da::ObjectId * > valuesOIds)
 It adds a new value to the map containing the histogram values. More...
 
void insert (te::dt::AbstractData *interval, unsigned int frequency)
 It adds a new value to the map containing the histogram values. The AbstractData will represent the interval and the unsigned int wil represent that intervals frequency. More...
 
bool isSummarized ()
 It returns a boolean that holds whether the histogram has been created from summarized values or not. More...
 
void setInterval (double new_Interval)
 It sets the histogram's interval. More...
 
void setMinValue (double new_minValue)
 It sets the histogram's minimum value. More...
 
void setStringInterval (std::set< std::string > new_Interval)
 It sets the histogram's string set of intervals. More...
 
void setSummarized (bool summarized)
 It sets the property that holds whether the histogram has been created from summarized values or not. More...
 
void setType (int new_type)
 It sets the histogram's type. More...
 
void setValues (std::map< te::dt::AbstractData *, unsigned int > values)
 It sets the histogram's values. More...
 
 ~Histogram ()
 Destructor. More...
 

Private Attributes

int m_histogramType
 Histogram's type. More...
 
double m_interval
 Histogram's numeric interval. More...
 
bool m_isSummarized
 This property holds whether the histogram has been created from summarized values or not. More...
 
double m_minValue
 Histogram's minimum numeric value. More...
 
std::set< std::string > m_StringIntervals
 Histogram unique strings set, represents string intervals. More...
 
HistogramValues m_values
 Histogram's values;. More...
 
IntervalToObjectIdSet m_valuesOids
 The intervals and ObjecIds ordered in a boost multi index container. More...
 

Detailed Description

A class to represent a Histogram.

Definition at line 56 of file Histogram.h.

Constructor & Destructor Documentation

te::qt::widgets::Histogram::Histogram ( )

Constructor.

te::qt::widgets::Histogram::~Histogram ( )

Destructor.

Member Function Documentation

void te::qt::widgets::Histogram::adjustOids ( te::dt::AbstractData interval,
std::vector< te::da::ObjectId * >  valuesOIds 
)

It will populate the IntervalToObjectIdSet with the given interval and it's matching objectIds.

Parameters
intervalThe interval that contains the given objectIds.
valuesOIdsThe vector containing the ObjectIds related to the given interval
void te::qt::widgets::Histogram::clear ( )

A function used to clear the contents of the histogram, deleting the pointers contained by the boost containers used to store the histogram's data.

te::da::ObjectIdSet* te::qt::widgets::Histogram::find ( te::dt::AbstractData interval)

It returns an ObjectIdSet containing all the object Ids associeted with the given interval.

Parameters
intervalThe interval that will be searched.
Note
it can return an empty ObjectIdSet if none ObjectIds were found. (f.e. if the user clicks on an empty area of the chart)
The caller will take ownership of the returned pointer
te::da::ObjectIdSet* te::qt::widgets::Histogram::find ( std::vector< te::dt::AbstractData * >  intervals)

It returns an ObjectIdSet containing all the object Ids associeted with the given interval list.

Parameters
intervalsA vector containing all the intervals within the selection box
Returns
An ObjectIdSet containing all the selected object Ids
Note
The caller will take ownership of the returned pointer
It will take ownership of the given pointers
const te::dt::AbstractData* te::qt::widgets::Histogram::find ( const te::da::ObjectId oid)

It returns an AbstractData representing the interval that contains the given ObjectId.

Parameters
oidThe ObjectId that will be searched.
Note
Returns NULL if no matching interval was found
double& te::qt::widgets::Histogram::getInterval ( )

It returns the histogram's interval. Will be invalid if the histogram was created based on string intervals.

Returns
The histogram's interval.
double& te::qt::widgets::Histogram::getMinValue ( )

It returns the histogram's minimum value. Will be invalid if the histogram was created based on string intervals.

Returns
The histogram's minimum value.
std::set<std::string>& te::qt::widgets::Histogram::getStringInterval ( )

It returns the histogram's string set of intervals. Will be invalid if the histogram was created based on numeric (double, float, etc) intervals.

Returns
The histogram's interval.
std::map<std::string, unsigned int> te::qt::widgets::Histogram::getStringValues ( )

It returns the map containing the histogram String values. The key is a unique string that represents an interval and the unsigned int is the frequency of that interval.

Returns
A map containing the histogram values.
int& te::qt::widgets::Histogram::getType ( )

It returns the histogram's type.

Returns
An int that represents the histogram's type.
std::map<double, unsigned int> te::qt::widgets::Histogram::getValues ( )

It returns the map containing the histogram values. The key is the minimum values of the histogram's interval, and the unsigned int is the frequency of that interval.

Returns
A map containing the histogram values.
void te::qt::widgets::Histogram::insert ( std::pair< te::dt::AbstractData *, unsigned int >  new_value,
std::vector< te::da::ObjectId * >  valuesOIds 
)

It adds a new value to the map containing the histogram values.

Parameters
new_valueThe value that will be added. The AbstractData represents the interval and the unsigned int represents that interval's frequency.
valuesOIdsA vector containing all the ObjectIds contained by the interval
Note
It will take the ownwership of the given pointers
void te::qt::widgets::Histogram::insert ( std::pair< te::dt::AbstractData *, unsigned int >  new_value)

It adds a new value to the map containing the histogram values. The AbstractData represents the interval and the unsigned int represents that interval's frequency.

Parameters
new_valueThe value that will be added.
void te::qt::widgets::Histogram::insert ( te::dt::AbstractData interval,
unsigned int  frequency,
std::vector< te::da::ObjectId * >  valuesOIds 
)

It adds a new value to the map containing the histogram values.

Parameters
intervalThe AbstractData that represents the interval and the unsigned int wil represent that intervals frequency.
frequencyThe unsigned int that represents that interval's frequency.
valuesOIdsA vector containing all the ObjectIds contained by the interval
Note
It will take the ownwership of the given pointers
void te::qt::widgets::Histogram::insert ( te::dt::AbstractData interval,
unsigned int  frequency 
)

It adds a new value to the map containing the histogram values. The AbstractData will represent the interval and the unsigned int wil represent that intervals frequency.

Parameters
intervalThe AbstractData that represents the interval and the unsigned int wil represent that intervals frequency.
frequencyThe unsigned int that represents that interval's frequency.
bool te::qt::widgets::Histogram::isSummarized ( )

It returns a boolean that holds whether the histogram has been created from summarized values or not.

Returns
A boolean that holds whether the histogram has been created from summarized values or not
void te::qt::widgets::Histogram::setInterval ( double  new_Interval)

It sets the histogram's interval.

Parameters
new_valuesThe new histogram's interval.
void te::qt::widgets::Histogram::setMinValue ( double  new_minValue)

It sets the histogram's minimum value.

Parameters
new_minValueThe new minimum value.
void te::qt::widgets::Histogram::setStringInterval ( std::set< std::string >  new_Interval)

It sets the histogram's string set of intervals.

Parameters
new_valuesThe new histogram's interval.
void te::qt::widgets::Histogram::setSummarized ( bool  summarized)

It sets the property that holds whether the histogram has been created from summarized values or not.

Parameters
summarizedA boolean that holds whether the histogram has been created from summarized values or not
void te::qt::widgets::Histogram::setType ( int  new_type)

It sets the histogram's type.

Parameters
new_typeThe new type
void te::qt::widgets::Histogram::setValues ( std::map< te::dt::AbstractData *, unsigned int >  values)

It sets the histogram's values.

Parameters
valuesThe new values. /note Any current data will be lost. /noter The ObjectIds will have to be manually adjusted later.

Member Data Documentation

int te::qt::widgets::Histogram::m_histogramType
private

Histogram's type.

Definition at line 251 of file Histogram.h.

double te::qt::widgets::Histogram::m_interval
private

Histogram's numeric interval.

Definition at line 253 of file Histogram.h.

bool te::qt::widgets::Histogram::m_isSummarized
private

This property holds whether the histogram has been created from summarized values or not.

Definition at line 250 of file Histogram.h.

double te::qt::widgets::Histogram::m_minValue
private

Histogram's minimum numeric value.

Definition at line 252 of file Histogram.h.

std::set<std::string> te::qt::widgets::Histogram::m_StringIntervals
private

Histogram unique strings set, represents string intervals.

Definition at line 254 of file Histogram.h.

HistogramValues te::qt::widgets::Histogram::m_values
private

Histogram's values;.

Definition at line 255 of file Histogram.h.

IntervalToObjectIdSet te::qt::widgets::Histogram::m_valuesOids
private

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

Definition at line 256 of file Histogram.h.


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