|
Mantid
|
PeakColumn : a Column sub-class used to display peak information as a TableWorkspace. More...
#include <PeakColumn.h>
Public Member Functions | |
| PeakColumn * | clone () const override |
| Clone. | |
| const std::vector< T > & | data () const |
| Reference to the data. | |
| bool | equals (const Column &, double, bool) const override |
| void | fromDouble (size_t i, double value) override |
| Assign from double. | |
| const std::type_info & | get_pointer_type_info () const override |
| Returns typeid for the pointer type to the data element in the column. | |
| const std::type_info & | get_type_info () const override |
| Returns typeid for the data in the column. | |
| bool | getReadOnly () const override |
| bool | isBool () const override |
| Specialized type check. | |
| bool | isNumber () const override |
| Are elements of the column interpretable as a number? | |
| PeakColumn (std::vector< T > &peaks, const std::string &name) | |
| Construct a column with a reference to the peaks list, a name & type. | |
| void | print (size_t index, std::ostream &s) const override |
| Prints. | |
| void | read (const size_t index, std::istringstream &in) override |
| Sets item from a stream. | |
| void | read (size_t index, const std::string &text) override |
| Read in some text and convert to a number in the PeaksWorkspace. | |
| size_t | size () const override |
| Number of individual elements in the column. | |
| long int | sizeOfData () const override |
| Must return overall memory size taken by the column. | |
| double | toDouble (size_t i) const override |
| Cast to double. | |
Public Member Functions inherited from Mantid::API::Column | |
| template<class T > | |
| T & | cell (size_t index) |
| Templated method for returning a value. No type checks are done. | |
| template<class T > | |
| const T & | cell (size_t index) const |
| Templated method for returning a value (const version). | |
| Column () | |
| virtual bool | equalsRelErr (const Column &, double, bool const =false) const |
| int | getLinkedYCol () const |
| int | getPlotType () const |
| get plot type | |
| template<class T > | |
| bool | isType () const |
| Type check. | |
| template<> | |
| bool | isType () const |
| const std::string & | name () const |
| Name (caption) of the column. | |
| template<class T = double> | |
| std::vector< T > | numeric_fill (size_t maxSize=std::numeric_limits< size_t >::max()) const |
| Fills a std vector with values from the column if the types are compatible. | |
| virtual double | operator[] (size_t i) const |
| return value casted to double (should be pure virtual) | |
| void | setLinkedYCol (const int yCol) |
| void | setName (const std::string &str) |
| Renames the column. | |
| void | setPlotType (int t) |
| Set plot type where. | |
| void | setReadOnly (bool isReadOnly) |
| Sets column read-only flag. | |
| virtual void | sortIndex (bool ascending, size_t start, size_t end, std::vector< size_t > &indexVec, std::vector< std::pair< size_t, size_t > > &equalRanges) const |
| Sort all or part of a vector of indices according to values in corresponding cells of this column. | |
| virtual void | sortValues (const std::vector< size_t > &indexVec) |
| Re-arrange values in this column according to indices in indexVec. | |
| const std::string & | type () const |
| Type of the column data. | |
| virtual | ~Column ()=default |
| Virtual destructor. | |
Protected Member Functions | |
| void | insert (size_t index) override |
| Inserts an item. | |
| void | remove (size_t index) override |
| Removes an item. | |
| void | resize (size_t count) override |
| Sets the new column size. | |
| const void * | void_pointer (size_t index) const override |
| Pointer to a data element. | |
| void * | void_pointer (size_t index) override |
| Pointer to a data element. | |
Protected Member Functions inherited from Mantid::API::Column | |
| bool | possibleToCompare (const Column &otherColumn) const |
Private Types | |
| using | CacheValueType = boost::variant< double, int, std::string, Kernel::V3D > |
| Type of the row cache value. | |
Private Member Functions | |
| void | setPeakHKLOrRunNumber (const size_t index, const double val) |
| Sets the correct value in the referenced peak. | |
Private Attributes | |
| int | m_hklPrec |
| Precision of hkl in table workspace. | |
| std::list< CacheValueType > | m_oldRows |
| std::vector< T > & | m_peaks |
| Reference to the peaks object saved in the PeaksWorkspace. | |
Additional Inherited Members | |
Protected Attributes inherited from Mantid::API::Column | |
| bool | m_isReadOnly |
| Column read-only flag. | |
| int | m_linkedYCol = -1 |
| For error columns - the index of the related data column. | |
| std::string | m_name |
| name | |
| int | m_plotType |
| plot type where None = 0 (means it has specifically been set to 'no plot type') NotSet = -1000 (this is the default and means plot style has not been set) X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6 | |
| std::string | m_type |
| type | |
PeakColumn : a Column sub-class used to display peak information as a TableWorkspace.
The column holds a reference to a vector of Peak objects. Values in the column are taken directly from those Peak objects.
Definition at line 28 of file PeakColumn.h.
|
private |
Type of the row cache value.
Definition at line 96 of file PeakColumn.h.
| Mantid::DataObjects::PeakColumn< T >::PeakColumn | ( | std::vector< T > & | peaks, |
| const std::string & | name | ||
| ) |
Construct a column with a reference to the peaks list, a name & type.
Constructor.
| peaks | :: vector of peaks |
| name | :: name for the column |
Definition at line 87 of file PeakColumn.cpp.
References Mantid::API::g_log, Mantid::Kernel::Logger::information(), Mantid::DataObjects::PeakColumn< T >::m_hklPrec, Mantid::API::Column::m_name, Mantid::API::Column::m_type, and Mantid::API::Column::name().
|
overridevirtual |
|
inline |
Reference to the data.
Definition at line 71 of file PeakColumn.h.
|
inlineoverridevirtual |
Reimplemented from Mantid::API::Column.
Definition at line 73 of file PeakColumn.h.
|
overridevirtual |
|
overridevirtual |
Returns typeid for the pointer type to the data element in the column.
Implements Mantid::API::Column.
Definition at line 120 of file PeakColumn.cpp.
|
overridevirtual |
Returns typeid for the data in the column.
Implements Mantid::API::Column.
Definition at line 100 of file PeakColumn.cpp.
|
overridevirtual |
Reimplemented from Mantid::API::Column.
Definition at line 217 of file PeakColumn.cpp.
|
overrideprotectedvirtual |
Inserts an item.
Inserts an item into the column.
Not implemented as this is controlled by the PeaksWorkspace
| index | :: The new index position (unused) |
| Exception::NotImplementedError |
Implements Mantid::API::Column.
Definition at line 251 of file PeakColumn.cpp.
References index, and UNUSED_ARG.
|
overridevirtual |
Specialized type check.
Implements Mantid::API::Column.
Definition at line 223 of file PeakColumn.cpp.
|
overridevirtual |
Are elements of the column interpretable as a number?
Implements Mantid::API::Column.
Definition at line 225 of file PeakColumn.cpp.
|
overridevirtual |
Prints.
Prints out the column string at the given row index.
| s | :: stream to output |
| index | :: row index |
Implements Mantid::API::Column.
Definition at line 140 of file PeakColumn.cpp.
References index.
|
overridevirtual |
Sets item from a stream.
Read in from stream and convert to a number in the PeaksWorkspace.
| index | :: index of the peak to modify |
| in | :: input stream |
Reimplemented from Mantid::API::Column.
Definition at line 200 of file PeakColumn.cpp.
References Mantid::Kernel::Logger::error(), Mantid::API::g_log, and index.
|
overridevirtual |
Read in some text and convert to a number in the PeaksWorkspace.
| text | :: string to read |
| index | :: index of the peak to modify |
Reimplemented from Mantid::API::Column.
Definition at line 179 of file PeakColumn.cpp.
References Mantid::Kernel::Strings::convert(), Mantid::Kernel::Logger::error(), Mantid::API::g_log, and index.
|
overrideprotectedvirtual |
Removes an item.
Removes an item from the column.
Not implemented as this is controlled by the PeaksWorkspace
| index | :: The index position removed(unused) |
| Exception::NotImplementedError |
Implements Mantid::API::Column.
Definition at line 264 of file PeakColumn.cpp.
References index, and UNUSED_ARG.
|
overrideprotectedvirtual |
Sets the new column size.
Sets a new size for the column.
Not implemented as this is controlled by the PeaksWorkspace
| count | :: Count of new column size (unused) |
| Exception::NotImplementedError |
Implements Mantid::API::Column.
Definition at line 238 of file PeakColumn.cpp.
References count, and UNUSED_ARG.
|
private |
Sets the correct value in the referenced peak.
Definition at line 348 of file PeakColumn.cpp.
References index.
|
inlineoverridevirtual |
Number of individual elements in the column.
Implements Mantid::API::Column.
Definition at line 35 of file PeakColumn.h.
|
overridevirtual |
Must return overall memory size taken by the column.
Implements Mantid::API::Column.
Definition at line 228 of file PeakColumn.cpp.
|
overridevirtual |
|
overrideprotectedvirtual |
Pointer to a data element.
Pointer to a data element in the PeaksWorkspace (const version)
| index | :: A row index pointing to the PeaksWorkspace |
Implements Mantid::API::Column.
Definition at line 286 of file PeakColumn.cpp.
References Mantid::DataObjects::Peak::getValueByColName(), index, and value.
|
overrideprotectedvirtual |
Pointer to a data element.
Pointer to a data element in the PeaksWorkspace (non-const version)
| index | :: A row index pointing to the PeaksWorkspace |
Implements Mantid::API::Column.
Definition at line 276 of file PeakColumn.cpp.
References index.
|
private |
Precision of hkl in table workspace.
Definition at line 93 of file PeakColumn.h.
Referenced by Mantid::DataObjects::PeakColumn< T >::PeakColumn().
|
mutableprivate |
Definition at line 98 of file PeakColumn.h.
|
private |
Reference to the peaks object saved in the PeaksWorkspace.
Definition at line 91 of file PeakColumn.h.