CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Public Attributes | List of all members
jocassview::OneDViewerData Class Reference

the 1d data wrapper More...

#include <one_d_viewer_data.h>

+ Inheritance diagram for jocassview::OneDViewerData:
+ Collaboration diagram for jocassview::OneDViewerData:

Public Member Functions

 OneDViewerData ()
 default constructor More...
 
virtual ~OneDViewerData ()
 destructor More...
 
virtual size_t size () const
 return the size of the data More...
 
virtual QPointF sample (size_t i) const
 return the x value for data point More...
 
virtual QRectF boundingRect () const
 return the bounding rectangle More...
 
void setResult (result_t::shared_pointer result)
 set the cass data to be wrapped by this More...
 
Data::result_t::shared_pointer result ()
 retrieve pointer to the cass data More...
 
const Data::result_t::shared_pointer result () const
 retrieve const pointer to the cass data More...
 
void setXRangeForLog (bool log)
 set up the bounding rect for when x should be log scale More...
 
void setYRangeForLog (bool log)
 set up the bounding rect for when y should be log scale More...
 
- Public Member Functions inherited from jocassview::Data
 Data ()
 constructor More...
 
virtual ~Data ()
 virtual destrutor More...
 
virtual void setResult (result_t::shared_pointer result)=0
 fill the data with the result More...
 
virtual void setSourceName (const QString &name)
 set the source name More...
 
virtual QString sourceName () const
 retrieve the source name More...
 
virtual bool wasUpdated () const
 retrieve was upDated flag More...
 

Public Attributes

QPointF _logMinPos
 the minimum positions in x and y for log scales More...
 
bool _xLog
 flag to tell whether x scale will be drawn in log More...
 
bool _yLog
 flag to tell whether y scale will be drawn in log More...
 
result_t::shared_pointer _result
 pointer to the cass data More...
 

Additional Inherited Members

- Public Types inherited from jocassview::Data
typedef cass::Result< float > result_t
 define the result type More...
 
- Protected Attributes inherited from jocassview::Data
QString _sourceName
 the name of the source More...
 
bool _wasUpdated
 flag to tell whether the data was updated More...
 

Detailed Description

the 1d data wrapper

Author
Lutz Foucar

Definition at line 32 of file one_d_viewer_data.h.

Constructor & Destructor Documentation

OneDViewerData::OneDViewerData ( )

default constructor

intializes the _hist pointer with 0

Definition at line 18 of file one_d_viewer_data.cpp.

OneDViewerData::~OneDViewerData ( )
virtual

destructor

deletes the _hist pointer

Definition at line 26 of file one_d_viewer_data.cpp.

Member Function Documentation

QRectF OneDViewerData::boundingRect ( ) const
virtual

return the bounding rectangle

Returns
the bounding rectangle

Definition at line 49 of file one_d_viewer_data.cpp.

References _logMinPos, _xLog, _yLog, QRectF::setLeft(), QRectF::setTop(), QPointF::x(), and QPointF::y().

Data::result_t::shared_pointer OneDViewerData::result ( )
virtual

retrieve pointer to the cass data

Returns
pointer to cass data

Implements jocassview::Data.

Definition at line 104 of file one_d_viewer_data.cpp.

References _result.

Referenced by sample(), setResult(), and size().

const Data::result_t::shared_pointer OneDViewerData::result ( ) const

retrieve const pointer to the cass data

Returns
const pointer to cass data

Definition at line 109 of file one_d_viewer_data.cpp.

References _result.

QPointF OneDViewerData::sample ( size_t  i) const
virtual

return the x value for data point

Parameters
ithe datapoint whos x value should be returned

Definition at line 36 of file one_d_viewer_data.cpp.

References result(), size(), cass::ACQIRIS::x, and cass::ACQIRIS::y.

Referenced by setResult().

void OneDViewerData::setResult ( result_t::shared_pointer  result)

set the cass data to be wrapped by this

Parameters
resultthe cass data to be wrapped

set the initial bounding rect in x

go through all data points of the curve and find min/max values for lin and log scale purposes

skip the check if the either coordinate of the point is not a number

find the max y value

find the min y value

find the min y value that is positive

find the min x value that is positive

Definition at line 59 of file one_d_viewer_data.cpp.

References _logMinPos, _result, result(), sample(), QPointF::setX(), QPointF::setY(), size(), QPointF::x(), cass::ACQIRIS::x, cass::Result< float >::xAxis, QPointF::y(), and cass::ACQIRIS::y.

Referenced by jocassview::OneDViewer::on_add_graph_triggered().

void OneDViewerData::setXRangeForLog ( bool  log)

set up the bounding rect for when x should be log scale

in case of log-scale: find the minimum x value that is bigger than 0 and set Left to be that value.

in case of lin-scale: set Left to the lowest value

Parameters
logwhen this parameter is true the scale will be set up for log-scale otherwise for lin-scale

Definition at line 114 of file one_d_viewer_data.cpp.

References _xLog.

Referenced by jocassview::OneDViewer::replot().

void OneDViewerData::setYRangeForLog ( bool  log)

set up the bounding rect for when y should be log scale

in case of log-scale: find the minimum y value that is bigger than 0 and a valid number, set bottom to that value.

in case of lin-scale: set bottom to the lowest value

Parameters
logwhen this parameter is true the scale will be set up for log-scale otherwise for lin-scale

Definition at line 119 of file one_d_viewer_data.cpp.

References _yLog.

Referenced by jocassview::OneDViewer::replot().

size_t OneDViewerData::size ( ) const
virtual

return the size of the data

Returns
the size of the vector that holds the data

Definition at line 31 of file one_d_viewer_data.cpp.

References result().

Referenced by sample(), and setResult().

Member Data Documentation

QPointF jocassview::OneDViewerData::_logMinPos

the minimum positions in x and y for log scales

Definition at line 113 of file one_d_viewer_data.h.

Referenced by boundingRect(), and setResult().

result_t::shared_pointer jocassview::OneDViewerData::_result

pointer to the cass data

Definition at line 122 of file one_d_viewer_data.h.

Referenced by result(), and setResult().

bool jocassview::OneDViewerData::_xLog

flag to tell whether x scale will be drawn in log

Definition at line 116 of file one_d_viewer_data.h.

Referenced by boundingRect(), and setXRangeForLog().

bool jocassview::OneDViewerData::_yLog

flag to tell whether y scale will be drawn in log

Definition at line 119 of file one_d_viewer_data.h.

Referenced by boundingRect(), and setYRangeForLog().


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