Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
kome::operation::ManipulatedSample Class Reference

ManipulatedSample class. More...

#include <ManipulatedSample.h>

Inheritance diagram for kome::operation::ManipulatedSample:
Inheritance graph
[legend]
Collaboration diagram for kome::operation::ManipulatedSample:
Collaboration graph
[legend]

Public Member Functions

 ManipulatedSample (kome::objects::Sample &org)
 constructor
 
virtual ~ManipulatedSample ()
 destructor
 
void addOperation (kome::objects::XYDataOperation *opt)
 add operation More...
 
void removeOperation (kome::objects::XYDataOperation *opt)
 remove operation More...
 
void clearOperation ()
 clear operation
 
kome::objects::SamplegetOrgSample ()
 gets original sample More...
 
void setOperationInfo (kome::plugin::PluginCall *call, kome::objects::SettingParameterValues *settings, kome::objects::DataGroupNode *stdGroup)
 set operation info More...
 
unsigned int getNumberOfOperation ()
 get number of operation More...
 
kome::objects::XYDataOperationgetOperation (int index)
 get operation More...
 
- Public Member Functions inherited from kome::objects::Sample
 Sample (SampleSet *sampleSet)
 constructor
 
virtual ~Sample ()
 destructor
 
SampleSetgetSampleSet ()
 gets sample set object More...
 
void setSampleIndex (const int index)
 sets sample index More...
 
int getSampleIndex ()
 gets sample index More...
 
void setName (const char *name)
 sets sample name More...
 
const char * getName ()
 gets sample name More...
 
void setType (const char *type)
 sets sample type More...
 
const char * getType ()
 gets sample type More...
 
void setInstrument (const char *instrument)
 sets instrument name More...
 
const char * getInstrument ()
 gets instrument name More...
 
void setMsCompany (const char *company)
 sets MS company More...
 
const char * getMsCompany ()
 gets MS company More...
 
void setSoftwareName (const char *name)
 sets software name More...
 
const char * getSoftwareName ()
 gets software name More...
 
void setSoftwareVersion (const char *version)
 sets software version More...
 
const char * getSoftwareVersion ()
 gets software version More...
 
void setOpened (const bool opened)
 sets opened flag More...
 
bool isOpened ()
 judges whther this sample is opened or not More...
 
void setEdited (const bool edited)
 sets edited flag More...
 
bool isEdited ()
 judges whther this sample is edited or not More...
 
DataGroupNodegetRootDataGroupNode ()
 gets root spectrum group More...
 
DataSetgetHiddenDataSet ()
 gets the hidden data set More...
 
unsigned int getNumberOfGroups ()
 gets the number of spectrum groups More...
 
DataGroupNodegetGroup (const unsigned int index)
 gets spectrum group More...
 
void setParallelReadable (const bool readable)
 sets parallel readable or not More...
 
bool isParallelReadable ()
 gets whether this sample is parallel readable or not More...
 
bool openSample (kome::core::Progress *progress=NULL)
 opens sample [out] progress progressbar to display More...
 
bool closeSample ()
 closes sample More...
 
void detectPeaksByAPI (Spectrum *spec, Peaks *peaks)
 detect peaks using Application Progreamming Interface More...
 
void setSampleId (int id)
 set sample id More...
 
int getSampleId ()
 get sample id More...
 
int issueSpecId ()
 to issue the spectrum id More...
 
SpectrumgetSpectrumById (int id)
 A spectrum is acquired by id. More...
 
int issueChromId (Sample *sample)
 to issue the chromatogram id More...
 
ChromatogramgetChromatogramById (int id)
 A schromatogram is acquired by id. More...
 
int issueGroupId (Sample *sample)
 to issue the group id More...
 
DataGroupNodegetGroupById (int id)
 A DataGroupNode is qcquired by id. More...
 
bool isSupportedAPIPeaks ()
 judges whether API peak detection is supported on this sample. More...
 
void setSupportedAPIPeaks (const bool supported)
 sets API peak dtection is supported on this sample. More...
 

Protected Member Functions

void addSpectrum (kome::objects::DataGroupNode *orgGroup, kome::objects::DataGroupNode *dstGroup)
 add spectrum More...
 
virtual bool onOpenSample (kome::objects::DataGroupNode *rootGroup, kome::core::Progress *progress=NULL)
 This method is called by openSample method. (abstract method) More...
 
virtual bool onCloseSample ()
 This method is called by closeSample method. (abstract method) More...
 
- Protected Member Functions inherited from kome::objects::Sample
void getGroups (DataGroupNode *parentGroup=NULL)
 gets spectrum groups More...
 
virtual void onDetectPeaksByAPI (Spectrum *spec, Peaks *peaks)
 This methos is called by detectPeakByAPI method.
 

Protected Attributes

kome::objects::Samplem_org
 
std::vector
< kome::objects::XYDataOperation * > 
m_opts
 
- Protected Attributes inherited from kome::objects::Sample
SampleSetm_sampleSet
 
int m_sampleIdx
 
int m_specId
 
std::string m_name
 
std::string m_type
 
std::string m_instrument
 
std::string m_company
 
std::string m_softwareName
 
std::string m_softwareVersion
 
DataGroupNodem_root
 
bool m_opened
 
bool m_edited
 
std::vector< DataGroupNode * > m_groups
 
bool m_parallelReadable
 
DataSet m_hiddenSet
 
bool m_supportedApiPeaks
 

Additional Inherited Members

- Static Public Member Functions inherited from kome::objects::Sample
static void resetId ()
 Reset the ID of the sample.
 
static bool isCommonProperty (const char *key)
 check whther the specified property key is common property or not More...
 
static int issueSampleId ()
 to issue the sample id More...
 
static SamplegetSampleById (int id)
 A sample is acquired by id. More...
 
- Static Protected Attributes inherited from kome::objects::Sample
static int m_optSampleId = 0
 
static std::vector< std::string > m_commonProps
 

Detailed Description

ManipulatedSample class.

Definition at line 25 of file ManipulatedSample.h.

Member Function Documentation

void kome::operation::ManipulatedSample::addOperation ( kome::objects::XYDataOperation opt)

add operation

Parameters
optxyData Operaiton object

Definition at line 95 of file ManipulatedSample.cpp.

95  {
96  bool bflg = false;
97  for( unsigned int i=0; i < m_opts.size(); i++ ){
98  if( opt == m_opts[i] ){
99  bflg = true;
100  break;
101  }
102  }
103  if( bflg ){
104  m_opts.push_back( opt );
105  }
106 }
std::vector< kome::objects::XYDataOperation * > m_opts
void kome::operation::ManipulatedSample::addSpectrum ( kome::objects::DataGroupNode orgGroup,
kome::objects::DataGroupNode dstGroup 
)
protected

add spectrum

Parameters
orgGroupgroup of original sample data
dstGroupgroup of manipulated sample data

Definition at line 68 of file ManipulatedSample.cpp.

68  {
69  if( orgGroup != NULL && dstGroup != NULL ){
70  // creating spectra
71  for( unsigned int i=0; i < orgGroup->getNumberOfSpectra(); i++ ){
73  dstGroup->addSpectrum( spec );
74  spec->setSample( this );
75  }
76 
77  // creating chromatograms
78  for( unsigned int i = 0; i < orgGroup->getNumberOfChromatograms(); i++ ) {
79  kome::objects::Chromatogram* orgChrom = orgGroup->getChromatogram( i );
80  TransformedChromatogram* chrom = new TransformedChromatogram( *orgChrom, false );
81  dstGroup->addChromatogram( chrom );
82  }
83 
84  // child groups
85  for( unsigned int i = 0; i < orgGroup->getNumberOfChildren(); i++ ) {
86  kome::objects::DataGroupNode* orgChild = orgGroup->getChild( i );
87  kome::objects::DataGroupNode* dstChild = dstGroup->createChildGroup( orgChild->getName() );
88 
89  addSpectrum( orgChild, dstChild );
90  }
91  }
92 }
group of spectrum management class
Definition: DataGroupNode.h:33
void setSample(ManipulatedSample *sample)
set sample object
DataGroupNode * getChild(const unsigned int index)
gets child group
const char * getName()
gets group name
virtual void addChromatogram(Chromatogram *chrom)
adds chromatogram
Definition: DataSet.cpp:217
unsigned int getNumberOfSpectra()
gets the number of spectra
Definition: DataSet.cpp:128
Spectrum * getSpectrum(const unsigned int index)
gets the number of spectra
Definition: DataSet.cpp:133
Chromatogram * getChromatogram(const unsigned int index)
gets chroamtogram
Definition: DataSet.cpp:146
#define NULL
Definition: CoreMacros.h:18
DataGroupNode * createChildGroup(const char *name)
creates new child group object
unsigned int getNumberOfChromatograms()
gets the number of chromatograms
Definition: DataSet.cpp:141
void addSpectrum(kome::objects::DataGroupNode *orgGroup, kome::objects::DataGroupNode *dstGroup)
add spectrum
chromatogram information management class
Definition: Chromatogram.h:33
unsigned int getNumberOfChildren()
gets the number of children
virtual void addSpectrum(Spectrum *spec)
adds spectrum to group
Definition: DataSet.cpp:167

Here is the call graph for this function:

unsigned int kome::operation::ManipulatedSample::getNumberOfOperation ( )

get number of operation

Returns
operation size

Definition at line 160 of file ManipulatedSample.cpp.

160  {
161  return m_opts.size();
162 }
std::vector< kome::objects::XYDataOperation * > m_opts
kome::objects::XYDataOperation * kome::operation::ManipulatedSample::getOperation ( int  index)

get operation

Returns
xyData Operation

Definition at line 165 of file ManipulatedSample.cpp.

165  {
166 
167  // check the index
168  if( index >= (int)m_opts.size() ) {
169  return NULL;
170  }
171  return m_opts[ index ];
172 
173 }
std::vector< kome::objects::XYDataOperation * > m_opts
#define NULL
Definition: CoreMacros.h:18
kome::objects::Sample * kome::operation::ManipulatedSample::getOrgSample ( )

gets original sample

Returns
org sample object

Definition at line 155 of file ManipulatedSample.cpp.

155  {
156  return &m_org;
157 }
bool kome::operation::ManipulatedSample::onCloseSample ( )
protectedvirtual

This method is called by closeSample method. (abstract method)

Returns
If true, it succeeded to close this sample.

Implements kome::objects::Sample.

Definition at line 143 of file ManipulatedSample.cpp.

143  {
144  if( m_root != NULL ){
145  delete m_root;
146  }
147  m_root = NULL;
148 
149  clearOperation();
150 
151  return true;
152 }
#define NULL
Definition: CoreMacros.h:18
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

bool kome::operation::ManipulatedSample::onOpenSample ( kome::objects::DataGroupNode rootGroup,
kome::core::Progress progress = NULL 
)
protectedvirtual

This method is called by openSample method. (abstract method)

Parameters
[out]rootGrouproot spectrum group
[out]progressprogress bar instance
Returns
If true, it succeeded to open this sample.

Implements kome::objects::Sample.

Definition at line 138 of file ManipulatedSample.cpp.

138  {
139  return true;
140 }
void kome::operation::ManipulatedSample::removeOperation ( kome::objects::XYDataOperation opt)

remove operation

Parameters
optxyData Operation object

Definition at line 109 of file ManipulatedSample.cpp.

109  {
110 
111  for( unsigned int i=0; i < m_opts.size(); i++ ){
112  if( opt == m_opts[i] ){
113  delete m_opts[i];
114  m_opts.erase( m_opts.begin() + i );
115  return;
116  }
117  }
118 }
std::vector< kome::objects::XYDataOperation * > m_opts
void kome::operation::ManipulatedSample::setOperationInfo ( kome::plugin::PluginCall *  call,
kome::objects::SettingParameterValues settings,
kome::objects::DataGroupNode stdGroup 
)

set operation info

Parameters
callplugin call
settingssetting parameter values
stdGroupstandard group

Definition at line 129 of file ManipulatedSample.cpp.

129  {
130  // create filter subtract object
131  Normalization* normaliz = new Normalization();
132 
133  normaliz->setNormalizInfo( call, settings, stdGroup );
134  m_opts.push_back( (kome::objects::XYDataOperation*)normaliz );
135 }
std::vector< kome::objects::XYDataOperation * > m_opts
normalization class
Definition: Normalization.h:28
void setNormalizInfo(kome::plugin::PluginCall *func, kome::objects::SettingParameterValues *settings, kome::objects::DataGroupNode *stdGroup)
sets filter information
xy data operation class

Here is the call graph for this function:

Member Data Documentation

std::vector<kome::objects::XYDataOperation*> kome::operation::ManipulatedSample::m_opts
protected

operations

Definition at line 44 of file ManipulatedSample.h.

kome::objects::Sample& kome::operation::ManipulatedSample::m_org
protected

orignal sample

Definition at line 41 of file ManipulatedSample.h.


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