OpenWalnut
1.5.0dev
|
This data set type contains a 1D histogram. More...
#include <WDataSetHistogram1D.h>
Public Types | |
typedef std::shared_ptr< WDataSetHistogram1D > | SPtr |
shared_ptr abbreviation More... | |
typedef std::shared_ptr< const WDataSetHistogram1D > | ConstSPtr |
const shared_ptr abbreviation More... | |
Public Types inherited from WDataSet | |
typedef std::shared_ptr< WDataSet > | SPtr |
Shared pointer abbreviation to a instance of this class. More... | |
typedef std::shared_ptr< const WDataSet > | ConstSPtr |
Shared pointer abbreviation to a const instance of this class. More... | |
Public Member Functions | |
WDataSetHistogram1D (std::shared_ptr< WHistogramBasic const > const &histo) | |
Creates a dataset encapsulating a histogram. More... | |
WDataSetHistogram1D (std::shared_ptr< WHistogramBasic const > const &histo, std::shared_ptr< std::vector< WColor > const > const &colors) | |
Construct a histogram and allows to set an array of colors used for the bins. More... | |
WDataSetHistogram1D () | |
Construct an empty and unusable instance. More... | |
virtual | ~WDataSetHistogram1D () |
Destroys this DataSet instance. More... | |
virtual const std::string | getName () const |
Gets the name of this prototype. More... | |
virtual const std::string | getDescription () const |
Gets the description for this prototype. More... | |
std::shared_ptr< WHistogramBasic const > const & | getHistogram () const |
Returns the histogram. More... | |
bool | hasColors () const |
Whether this dataset has colors associated with the bins. More... | |
WColor | getColor (std::size_t bin) const |
Get the color of a bin. More... | |
Public Member Functions inherited from WDataSet | |
WDataSet () | |
This constructor should be used if a dataSet does not stem from a file. More... | |
virtual | ~WDataSet () |
Since WDataSet is a base class and thus should be polymorphic we add virtual destructor. More... | |
void | setFilename (const std::string filename) |
Set the name of the file that this data set stems from. More... | |
std::string | getFilename () const |
Get the name of the file that this data set stems from. More... | |
OW_API_DEPRECATED void | setFileName (const std::string filename) |
Set the name of the file that this data set stems from. More... | |
OW_API_DEPRECATED std::string | getFileName () const |
Get the name of the file that this data set stems from. More... | |
virtual bool | isTexture () const |
Determines whether this dataset can be used as a texture. More... | |
virtual std::shared_ptr< WDataSetVector > | isVectorDataSet () |
Checks if this dataset is a vector dataset. More... | |
virtual osg::ref_ptr< WDataTexture3D > | getTexture () const |
Returns the texture- representation of the dataset. More... | |
std::shared_ptr< WProperties > | getProperties () const |
Return a pointer to the properties object of the dataset. More... | |
std::shared_ptr< WProperties > | getInformationProperties () const |
Return a pointer to the information properties object of the dataset. More... | |
Public Member Functions inherited from WTransferable | |
WTransferable () | |
Default constructor. More... | |
virtual | ~WTransferable () |
Destructor. More... | |
Public Member Functions inherited from WPrototyped | |
WPrototyped () | |
Default constructor. More... | |
virtual | ~WPrototyped () |
Destructor. More... | |
template<typename T > | |
bool | isA () |
Checks whether the actual prototype has the specified runtime type. More... | |
Static Public Member Functions | |
static std::shared_ptr< WPrototyped > | getPrototype () |
Returns a prototype instantiated with the true type of the deriving class. More... | |
Static Public Member Functions inherited from WDataSet | |
static std::shared_ptr< WPrototyped > | getPrototype () |
Returns a prototype instantiated with the true type of the deriving class. More... | |
Static Protected Attributes | |
static std::shared_ptr< WPrototyped > | m_prototype = std::shared_ptr< WPrototyped >() |
The prototype as singleton. More... | |
Static Protected Attributes inherited from WDataSet | |
static std::shared_ptr< WPrototyped > | m_prototype = std::shared_ptr< WPrototyped >() |
The prototype as singleton. More... | |
Private Attributes | |
std::shared_ptr< WHistogramBasic const > const | m_histogram |
The histogram. More... | |
std::shared_ptr< std::vector< WColor > const > const | m_colors |
The colors for the bins. More... | |
Additional Inherited Members | |
Protected Attributes inherited from WDataSet | |
std::shared_ptr< WProperties > | m_properties |
The property object for the dataset. More... | |
std::shared_ptr< WProperties > | m_infoProperties |
The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". More... | |
This data set type contains a 1D histogram.
Definition at line 40 of file WDataSetHistogram1D.h.
typedef std::shared_ptr< const WDataSetHistogram1D > WDataSetHistogram1D::ConstSPtr |
const shared_ptr abbreviation
Definition at line 51 of file WDataSetHistogram1D.h.
typedef std::shared_ptr< WDataSetHistogram1D > WDataSetHistogram1D::SPtr |
shared_ptr abbreviation
Definition at line 46 of file WDataSetHistogram1D.h.
|
explicit |
Creates a dataset encapsulating a histogram.
The histogram will be copied in order to prevent changes to the data.
histo | The histogram to use. |
Definition at line 34 of file WDataSetHistogram1D.cpp.
WDataSetHistogram1D::WDataSetHistogram1D | ( | std::shared_ptr< WHistogramBasic const > const & | histo, |
std::shared_ptr< std::vector< WColor > const > const & | colors | ||
) |
Construct a histogram and allows to set an array of colors used for the bins.
histo | The histogram. |
colors | An array of one color per bin. |
Definition at line 41 of file WDataSetHistogram1D.cpp.
WDataSetHistogram1D::WDataSetHistogram1D | ( | ) |
Construct an empty and unusable instance.
This is needed for the prototype mechanism.
Definition at line 49 of file WDataSetHistogram1D.cpp.
Referenced by getPrototype().
|
virtual |
Destroys this DataSet instance.
Definition at line 55 of file WDataSetHistogram1D.cpp.
WColor WDataSetHistogram1D::getColor | ( | std::size_t | bin | ) | const |
Get the color of a bin.
bin | The index of the bin to get the color from. |
Definition at line 89 of file WDataSetHistogram1D.cpp.
References m_colors.
|
virtual |
Gets the description for this prototype.
Reimplemented from WDataSet.
Definition at line 64 of file WDataSetHistogram1D.cpp.
std::shared_ptr< WHistogramBasic const > const & WDataSetHistogram1D::getHistogram | ( | ) | const |
Returns the histogram.
Definition at line 79 of file WDataSetHistogram1D.cpp.
References m_histogram.
|
virtual |
Gets the name of this prototype.
Reimplemented from WDataSet.
Definition at line 59 of file WDataSetHistogram1D.cpp.
|
static |
Returns a prototype instantiated with the true type of the deriving class.
Definition at line 69 of file WDataSetHistogram1D.cpp.
References m_prototype, and WDataSetHistogram1D().
bool WDataSetHistogram1D::hasColors | ( | ) | const |
Whether this dataset has colors associated with the bins.
Definition at line 84 of file WDataSetHistogram1D.cpp.
References m_colors, and m_histogram.
|
private |
The colors for the bins.
Definition at line 134 of file WDataSetHistogram1D.h.
Referenced by getColor(), and hasColors().
|
private |
The histogram.
Definition at line 131 of file WDataSetHistogram1D.h.
Referenced by getHistogram(), and hasColors().
|
staticprotected |
The prototype as singleton.
Definition at line 127 of file WDataSetHistogram1D.h.
Referenced by getPrototype().