OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Attributes | List of all members
WDataSetHistogram1D Class Reference

This data set type contains a 1D histogram. More...

#include <WDataSetHistogram1D.h>

+ Inheritance diagram for WDataSetHistogram1D:
+ Collaboration diagram for WDataSetHistogram1D:

Public Types

typedef std::shared_ptr< WDataSetHistogram1DSPtr
 shared_ptr abbreviation More...
 
typedef std::shared_ptr< const WDataSetHistogram1DConstSPtr
 const shared_ptr abbreviation More...
 
- Public Types inherited from WDataSet
typedef std::shared_ptr< WDataSetSPtr
 Shared pointer abbreviation to a instance of this class. More...
 
typedef std::shared_ptr< const WDataSetConstSPtr
 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< WDataSetVectorisVectorDataSet ()
 Checks if this dataset is a vector dataset. More...
 
virtual osg::ref_ptr< WDataTexture3DgetTexture () const
 Returns the texture- representation of the dataset. More...
 
std::shared_ptr< WPropertiesgetProperties () const
 Return a pointer to the properties object of the dataset. More...
 
std::shared_ptr< WPropertiesgetInformationProperties () 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< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 
- Static Public Member Functions inherited from WDataSet
static std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 

Static Protected Attributes

static std::shared_ptr< WPrototypedm_prototype = std::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 
- Static Protected Attributes inherited from WDataSet
static std::shared_ptr< WPrototypedm_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< WPropertiesm_properties
 The property object for the dataset. More...
 
std::shared_ptr< WPropertiesm_infoProperties
 The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". More...
 

Detailed Description

This data set type contains a 1D histogram.

Definition at line 40 of file WDataSetHistogram1D.h.

Member Typedef Documentation

◆ ConstSPtr

typedef std::shared_ptr< const WDataSetHistogram1D > WDataSetHistogram1D::ConstSPtr

const shared_ptr abbreviation

Definition at line 51 of file WDataSetHistogram1D.h.

◆ SPtr

typedef std::shared_ptr< WDataSetHistogram1D > WDataSetHistogram1D::SPtr

shared_ptr abbreviation

Definition at line 46 of file WDataSetHistogram1D.h.

Constructor & Destructor Documentation

◆ WDataSetHistogram1D() [1/3]

WDataSetHistogram1D::WDataSetHistogram1D ( std::shared_ptr< WHistogramBasic const > const &  histo)
explicit

Creates a dataset encapsulating a histogram.

The histogram will be copied in order to prevent changes to the data.

Parameters
histoThe histogram to use.

Definition at line 34 of file WDataSetHistogram1D.cpp.

◆ WDataSetHistogram1D() [2/3]

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.

Parameters
histoThe histogram.
colorsAn array of one color per bin.

Definition at line 41 of file WDataSetHistogram1D.cpp.

◆ WDataSetHistogram1D() [3/3]

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

+ Here is the caller graph for this function:

◆ ~WDataSetHistogram1D()

WDataSetHistogram1D::~WDataSetHistogram1D ( )
virtual

Destroys this DataSet instance.

Definition at line 55 of file WDataSetHistogram1D.cpp.

Member Function Documentation

◆ getColor()

WColor WDataSetHistogram1D::getColor ( std::size_t  bin) const

Get the color of a bin.

Parameters
binThe index of the bin to get the color from.
Returns
The color of the bin.

Definition at line 89 of file WDataSetHistogram1D.cpp.

References m_colors.

◆ getDescription()

std::string const WDataSetHistogram1D::getDescription ( ) const
virtual

Gets the description for this prototype.

Returns
the description

Reimplemented from WDataSet.

Definition at line 64 of file WDataSetHistogram1D.cpp.

◆ getHistogram()

std::shared_ptr< WHistogramBasic const > const & WDataSetHistogram1D::getHistogram ( ) const

Returns the histogram.

Returns
A const ref pointer to the histogram.

Definition at line 79 of file WDataSetHistogram1D.cpp.

References m_histogram.

◆ getName()

std::string const WDataSetHistogram1D::getName ( ) const
virtual

Gets the name of this prototype.

Returns
the name.

Reimplemented from WDataSet.

Definition at line 59 of file WDataSetHistogram1D.cpp.

◆ getPrototype()

std::shared_ptr< WPrototyped > WDataSetHistogram1D::getPrototype ( )
static

Returns a prototype instantiated with the true type of the deriving class.

Returns
the prototype.

Definition at line 69 of file WDataSetHistogram1D.cpp.

References m_prototype, and WDataSetHistogram1D().

+ Here is the call graph for this function:

◆ hasColors()

bool WDataSetHistogram1D::hasColors ( ) const

Whether this dataset has colors associated with the bins.

Returns
true, if this dataset has colors.

Definition at line 84 of file WDataSetHistogram1D.cpp.

References m_colors, and m_histogram.

Member Data Documentation

◆ m_colors

std::shared_ptr< std::vector< WColor > const > const WDataSetHistogram1D::m_colors
private

The colors for the bins.

Definition at line 134 of file WDataSetHistogram1D.h.

Referenced by getColor(), and hasColors().

◆ m_histogram

std::shared_ptr< WHistogramBasic const > const WDataSetHistogram1D::m_histogram
private

The histogram.

Definition at line 131 of file WDataSetHistogram1D.h.

Referenced by getHistogram(), and hasColors().

◆ m_prototype

std::shared_ptr< WPrototyped > WDataSetHistogram1D::m_prototype = std::shared_ptr< WPrototyped >()
staticprotected

The prototype as singleton.

Definition at line 127 of file WDataSetHistogram1D.h.

Referenced by getPrototype().


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