Vespucci  1.0.0
VespucciWorkspace Class Reference

The VespucciWorkspace class A class which contains all "global variables" (that aren't held in MainWindow) More...

#include <vespucciworkspace.h>

Public Member Functions

 VespucciWorkspace (QString settings_file)
 VespucciWorkspace::VespucciWorkspace Constructor. More...
 
 ~VespucciWorkspace ()
 VespucciWorkspace::~VespucciWorkspace Destructor. More...
 
QStringList dataset_names () const
 
void AddDataset (QSharedPointer< VespucciDataset > dataset)
 VespucciWorkspace::AddDataset. More...
 
void RemoveDataset (QString name)
 VespucciWorkspace::RemoveDataset. More...
 
void UpdateModel ()
 VespucciWorkspace::UpdateModel Call when a VespucciDataset adds or removes a new object. More...
 
void RemoveDatasetAt (const QModelIndex &parent)
 VespucciWorkspace::RemoveDatasetAt. More...
 
QSharedPointer< VespucciDatasetDatasetAt (const QModelIndex &parent)
 
int dataset_loading_count () const
 VespucciWorkspace::dataset_loading_count. More...
 
void set_directory (QString directory)
 VespucciWorkspace::set_directory. More...
 
QString directory () const
 VespucciWorkspace::directory. More...
 
QString * directory_ptr ()
 VespucciWorkspace::directory_ptr. More...
 
void SetPointers (MainWindow *main_window, DatasetTreeModel *tree_model)
 VespucciWorkspace::SetPointers. More...
 
MainWindowmain_window ()
 VespucciWorkspace::main_window. More...
 
double GetWavelengthMin (const QString &key) const
 VespucciWorkspace::GetWavelengthMin. More...
 
double GetWavelengthMax (const QString &key) const
 VespucciWorkspace::GetWavelengthMax. More...
 
QSharedPointer< VespucciDatasetGetDataset (const QString &key) const
 VespucciWorkspace::GetDataset. More...
 
QSharedPointer< AnalysisResultsGetAnalysisResults (const QString &dataset_key, const QString &results_key) const
 VespucciWorkspace::GetAnalysisResults. More...
 
QSharedPointer< MapDataGetMap (const QString &dataset_key, const QString &map_key) const
 
QSharedPointer< MapDataGetMap (const QStringList &map_keys)
 
const mat & GetAuxiliaryMatrix (const QString &dataset_key, const QString &matrix_key) const
 
const mat & GetResultsMatrix (const QString &dataset_key, const QString &results_key, const QString &matrix_key) const
 
const mat & GetCoreMatrix (const QString &dataset_key, const QString &matrix_key) const
 
QCPRangeglobal_data_range ()
 VespucciWorkspace::global_data_range. More...
 
QCPColorGradientglobal_gradient ()
 VespucciWorkspace::global_gradient. More...
 
void AddGlobalGradient (QString name, QString gradient_key, double lower, double upper)
 VespucciWorkspace::AddGlobalGradient. More...
 
void RecalculateGlobalGradient (QString name)
 
void RemoveColorRange (QString name)
 VespucciWorkspace::RemoveColorRange. More...
 
QStringList GlobalGradientKeys ()
 
QMap< QString, Vespucci::GlobalGradientglobal_gradients ()
 
QCPColorGradient GetGradient (QString key, int count=0)
 
Vespucci::GlobalGradient GetGlobalGradient (QString key)
 
QStringList GradientNames (bool include_cluster=false)
 
void ClearDatasets ()
 VespucciWorkspace::ClearDatasets Clears the internal container for datasets in the list model. More...
 
QList< QSharedPointer< VespucciDataset > > * datasets ()
 
unsigned int UpdateCount ()
 VespucciWorkspace::UpdateCount. More...
 
DatasetTreeModeldataset_tree_model () const
 dataset_list_model More...
 
void ResetSettings ()
 
void CheckSettings ()
 
QSettings * settings ()
 
DataModeldata_model ()
 
const mat & GetMatrix (const QStringList &keys) const
 VespucciWorkspace::GetMatrix. More...
 
bool HasMatrix (const QStringList &keys) const
 
bool Mappable (const QStringList &keys) const
 
bool Plottable (const QStringList &keys) const
 

Detailed Description

The VespucciWorkspace class A class which contains all "global variables" (that aren't held in MainWindow)

Definition at line 44 of file vespucciworkspace.h.

Constructor & Destructor Documentation

VespucciWorkspace::VespucciWorkspace ( QString  settings_file)

VespucciWorkspace::VespucciWorkspace Constructor.

Definition at line 28 of file vespucciworkspace.cpp.

VespucciWorkspace::~VespucciWorkspace ( )

VespucciWorkspace::~VespucciWorkspace Destructor.

Definition at line 83 of file vespucciworkspace.cpp.

Member Function Documentation

void VespucciWorkspace::AddDataset ( QSharedPointer< VespucciDataset dataset)

VespucciWorkspace::AddDataset.

Parameters
datasetAdd a dataset to the datasets_ QList

Definition at line 113 of file vespucciworkspace.cpp.

void VespucciWorkspace::AddGlobalGradient ( QString  name,
QString  gradient_key,
double  lower,
double  upper 
)

VespucciWorkspace::AddGlobalGradient.

Parameters
name
gradient_key
lower
upper

Definition at line 378 of file vespucciworkspace.cpp.

void VespucciWorkspace::CheckSettings ( )

Definition at line 457 of file vespucciworkspace.cpp.

void VespucciWorkspace::ClearDatasets ( )

VespucciWorkspace::ClearDatasets Clears the internal container for datasets in the list model.

Definition at line 413 of file vespucciworkspace.cpp.

DataModel * VespucciWorkspace::data_model ( )

Definition at line 512 of file vespucciworkspace.cpp.

int VespucciWorkspace::dataset_loading_count ( ) const

VespucciWorkspace::dataset_loading_count.

Returns
A count of the datasets that have been loaded.

Definition at line 175 of file vespucciworkspace.cpp.

QStringList VespucciWorkspace::dataset_names ( ) const

Definition at line 90 of file vespucciworkspace.cpp.

DatasetTreeModel * VespucciWorkspace::dataset_tree_model ( ) const

dataset_list_model

Returns
The dataset list model

Definition at line 430 of file vespucciworkspace.cpp.

QSharedPointer< VespucciDataset > VespucciWorkspace::DatasetAt ( const QModelIndex &  parent)

Definition at line 160 of file vespucciworkspace.cpp.

QList<QSharedPointer<VespucciDataset> >* VespucciWorkspace::datasets ( )
QString VespucciWorkspace::directory ( ) const

VespucciWorkspace::directory.

Returns
The global working directory

Definition at line 184 of file vespucciworkspace.cpp.

QString * VespucciWorkspace::directory_ptr ( )

VespucciWorkspace::directory_ptr.

Returns
Pointer to global working directory

Definition at line 291 of file vespucciworkspace.cpp.

QSharedPointer< AnalysisResults > VespucciWorkspace::GetAnalysisResults ( const QString &  dataset_key,
const QString &  results_key 
) const

VespucciWorkspace::GetAnalysisResults.

Parameters
dataset_key
results_key
Returns
Will throw invalid_argument (from DataModel) if key(s) do(es) not exist

Definition at line 241 of file vespucciworkspace.cpp.

const mat & VespucciWorkspace::GetAuxiliaryMatrix ( const QString &  dataset_key,
const QString &  matrix_key 
) const

Definition at line 256 of file vespucciworkspace.cpp.

const mat & VespucciWorkspace::GetCoreMatrix ( const QString &  dataset_key,
const QString &  matrix_key 
) const

Definition at line 266 of file vespucciworkspace.cpp.

QSharedPointer< VespucciDataset > VespucciWorkspace::GetDataset ( const QString &  key) const

VespucciWorkspace::GetDataset.

Parameters
key
Returns
Will throw invalid argument (from DataModel) if key does not exist

Definition at line 230 of file vespucciworkspace.cpp.

Vespucci::GlobalGradient VespucciWorkspace::GetGlobalGradient ( QString  key)

Definition at line 339 of file vespucciworkspace.cpp.

QCPColorGradient VespucciWorkspace::GetGradient ( QString  key,
int  count = 0 
)

Definition at line 319 of file vespucciworkspace.cpp.

QSharedPointer< MapData > VespucciWorkspace::GetMap ( const QString &  dataset_key,
const QString &  map_key 
) const

Definition at line 246 of file vespucciworkspace.cpp.

QSharedPointer< MapData > VespucciWorkspace::GetMap ( const QStringList &  map_keys)

Definition at line 251 of file vespucciworkspace.cpp.

const mat & VespucciWorkspace::GetMatrix ( const QStringList &  keys) const

VespucciWorkspace::GetMatrix.

Parameters
keys
Returns
Retruns empty matrix if invalid keys

Definition at line 522 of file vespucciworkspace.cpp.

const mat & VespucciWorkspace::GetResultsMatrix ( const QString &  dataset_key,
const QString &  results_key,
const QString &  matrix_key 
) const

Definition at line 261 of file vespucciworkspace.cpp.

double VespucciWorkspace::GetWavelengthMax ( const QString &  key) const

VespucciWorkspace::GetWavelengthMax.

Parameters
rowIndex of the dataset
Returns
Maximum of the spectral abscissa

Definition at line 212 of file vespucciworkspace.cpp.

double VespucciWorkspace::GetWavelengthMin ( const QString &  key) const

VespucciWorkspace::GetWavelengthMin.

Parameters
rowIndex of the dataset
Returns
Minimum of the spectral abscissa

Definition at line 276 of file vespucciworkspace.cpp.

QCPRange * VespucciWorkspace::global_data_range ( )

VespucciWorkspace::global_data_range.

Returns
The global data range

Definition at line 357 of file vespucciworkspace.cpp.

QCPColorGradient * VespucciWorkspace::global_gradient ( )

VespucciWorkspace::global_gradient.

Returns
The global color gradient

Definition at line 366 of file vespucciworkspace.cpp.

QMap< QString, Vespucci::GlobalGradient > VespucciWorkspace::global_gradients ( )

Definition at line 314 of file vespucciworkspace.cpp.

QStringList VespucciWorkspace::GlobalGradientKeys ( )

Definition at line 309 of file vespucciworkspace.cpp.

QStringList VespucciWorkspace::GradientNames ( bool  include_cluster = false)

Definition at line 344 of file vespucciworkspace.cpp.

bool VespucciWorkspace::HasMatrix ( const QStringList &  keys) const

Definition at line 533 of file vespucciworkspace.cpp.

MainWindow * VespucciWorkspace::main_window ( )

VespucciWorkspace::main_window.

Returns
Pointer to the main window

Definition at line 202 of file vespucciworkspace.cpp.

bool VespucciWorkspace::Mappable ( const QStringList &  keys) const

Definition at line 538 of file vespucciworkspace.cpp.

bool VespucciWorkspace::Plottable ( const QStringList &  keys) const

Definition at line 543 of file vespucciworkspace.cpp.

void VespucciWorkspace::RecalculateGlobalGradient ( QString  name)

Definition at line 386 of file vespucciworkspace.cpp.

void VespucciWorkspace::RemoveColorRange ( QString  name)

VespucciWorkspace::RemoveColorRange.

Parameters
nameRemoves a color range from the workspace. Maps using this color range are not affected. User must manually trigger recalculation per map

Definition at line 304 of file vespucciworkspace.cpp.

void VespucciWorkspace::RemoveDataset ( QString  name)

VespucciWorkspace::RemoveDataset.

Parameters
nameWe forget about this dataset. This does not guarantee that the memory is deallocated, as the QSharedPointer may still belong to another active object (we make sure to call QSharedPointer::clear at the ends of dialogs that handle QSharedPointers for this reason).

Definition at line 127 of file vespucciworkspace.cpp.

void VespucciWorkspace::RemoveDatasetAt ( const QModelIndex &  parent)

VespucciWorkspace::RemoveDatasetAt.

Parameters
iUseful when the index is known (as when the list is being iterated) These functions should be safe because the names list and the object list only update together

Definition at line 151 of file vespucciworkspace.cpp.

void VespucciWorkspace::ResetSettings ( )

Definition at line 435 of file vespucciworkspace.cpp.

void VespucciWorkspace::set_directory ( QString  directory)

VespucciWorkspace::set_directory.

Parameters
directoryNew global directory Sets the global directory

Definition at line 193 of file vespucciworkspace.cpp.

void VespucciWorkspace::SetPointers ( MainWindow main_window,
DatasetTreeModel tree_model 
)

VespucciWorkspace::SetPointers.

Parameters
main_windowSet pointers to the main window in the workspace (mainwindow requires workspace).

Definition at line 100 of file vespucciworkspace.cpp.

QSettings * VespucciWorkspace::settings ( )

Definition at line 507 of file vespucciworkspace.cpp.

unsigned int VespucciWorkspace::UpdateCount ( )

VespucciWorkspace::UpdateCount.

Returns
The new count Increments dataset loading count

Definition at line 421 of file vespucciworkspace.cpp.

void VespucciWorkspace::UpdateModel ( )

VespucciWorkspace::UpdateModel Call when a VespucciDataset adds or removes a new object.

Definition at line 136 of file vespucciworkspace.cpp.


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