SignatureLibrary Class Reference

A container for multiple signatures. More...

#include <SignatureLibrary.h>

Inheritance diagram for SignatureLibrary:

Inheritance graph

List of all members.

Public Member Functions

virtual const std::vector
< double > & 
getAbscissa () const =0
virtual const std::vector
< double > & 
getOriginalAbscissa () const =0
virtual const RasterElementgetOriginalOrdinateData () const =0
virtual RasterElementgetOriginalOrdinateData ()=0
virtual const double * getOrdinateData () const =0
virtual const double * getOrdinateData (unsigned int index) const =0
virtual std::set< std::string > getSignatureNames () const =0
virtual std::string getSignatureName (unsigned int index) const =0
virtual const SignaturegetSignature (unsigned int index) const =0
virtual const SignaturegetSignature (const std::string &name) const =0
const std::string & getAbscissaName () const
virtual bool resample (const std::vector< double > &abscissa)=0
virtual void desample ()=0
virtual bool import (const std::string &filename, const std::string &importerName, Progress *pProgress=NULL)=0
virtual bool insertSignature (Signature *pSignature)=0
virtual bool insertSignatures (const std::vector< Signature * > &signatures)=0
virtual bool removeSignature (Signature *pSignature, bool bDelete=false)=0
virtual bool removeSignatures (const std::vector< Signature * > &signatures, bool bDelete=false)=0
virtual void clear (bool bDelete=false)=0

Protected Member Functions

virtual ~SignatureLibrary ()


Detailed Description

A container for multiple signatures.

This class provides encapsulation for multiple signatures into a single object. The SignatureLibrary is also a SignatureSet, so it can contain metadata, a description, and acquisition values. The Signature Library's set of Signatures is largely immutable, in that, except for an empty library, new signatures cannot be added to it, and, for the most part, signatures cannot be removed from it.

When a SignatureLibrary is deleted, Signatures contained in the set are automatically deleted. It owns its signatures.

The primary benefit of a SignatureLibrary over a standard SignatureSet is that the SignatureLibrary can store much larger collections of signatures and can more efficiently and conveniently resample them. Additionally, a SignatureLibrary provides faster, more convenient access to its primary ordinate data.

This subclass of Subject will notify upon the following conditions:

See also:
SignatureSet

Definition at line 47 of file SignatureLibrary.h.


Constructor & Destructor Documentation

virtual SignatureLibrary::~SignatureLibrary (  )  [protected, virtual]

This should be destroyed by calling ModelServices::destroyElement.

Definition at line 321 of file SignatureLibrary.h.


Member Function Documentation

virtual const std::vector<double>& SignatureLibrary::getAbscissa (  )  const [pure virtual]

Returns the values that the signature ordinate data is currently sampled to.

Returns the values that the signature ordinate data is currently sampled to. If the library has not been resampled, this will return getOriginalAbscissa().

Returns:
The active abscissa of the library.
See also:
getOriginalAbscissa()

virtual const std::vector<double>& SignatureLibrary::getOriginalAbscissa (  )  const [pure virtual]

Returns the values that the raw signature library ordinate data is sampled to.

Returns:
The original abscissa of the library.

virtual const RasterElement* SignatureLibrary::getOriginalOrdinateData (  )  const [pure virtual]

Returns the raw ordinate data.

The raw ordinate data is returned as an on-disk RasterElement.

Returns:
The raw ordinate data.

virtual RasterElement* SignatureLibrary::getOriginalOrdinateData (  )  [pure virtual]

Returns the raw ordinate data.

The raw ordinate data is returned as an on-disk RasterElement.

Returns:
The raw ordinate data.

virtual const double* SignatureLibrary::getOrdinateData (  )  const [pure virtual]

Returns the resampled ordinate data.

The resampled ordinate data is returned as a single array of doubles with each signature's ordinate data being contiguous. The number of ordinate samples for each signature will be the same as the number of abscissa values returned from getAbscissa(). If the library has not been resampled, this returns NULL.

Returns:
The entire resampled signature library's ordinate data.

virtual const double* SignatureLibrary::getOrdinateData ( unsigned int  index  )  const [pure virtual]

Returns the resampled ordinate data of a specified signature.

The resampled ordinate data is returned as a single array of doubles. The number of ordinate samples for the signature will be the same as the number of abscissa values returned from getAbscissa(). If the library has not been resampled, this returns NULL.

Parameters:
index The index of the signature for which the ordinate data is to be retrieved.
Returns:
The signature's resampled ordinate data, or NULL of the library has not been resampled or the index is invalid.

virtual std::set<std::string> SignatureLibrary::getSignatureNames (  )  const [pure virtual]

Returns the names of all of the signatures in the library.

Returns:
The names of all of the signatures in the library.

virtual std::string SignatureLibrary::getSignatureName ( unsigned int  index  )  const [pure virtual]

Returns the name of the specified signature.

Parameters:
index The index of the signature for which the name is to be retrieved.
Returns:
The name of the specified signature or an empty string if the index is invalid.

virtual const Signature* SignatureLibrary::getSignature ( unsigned int  index  )  const [pure virtual]

Returns the specified signature.

Parameters:
index The index of the signature to be retrieved.
Returns:
The specified signature, or NULL if the index is invalid.

virtual const Signature* SignatureLibrary::getSignature ( const std::string &  name  )  const [pure virtual]

Returns the specified signature.

Parameters:
name The name of the signature to be retrieved.
Returns:
The specified signature or NULL if the specified signature does not exist in the library.

const std::string& SignatureLibrary::getAbscissaName (  )  const

Returns the name of the library's abscissa.

Returns:
The abscissa name.

virtual bool SignatureLibrary::resample ( const std::vector< double > &  abscissa  )  [pure virtual]

Resamples the raw ordinate data to the specified abscissa.

Resamples the entire raw ordinate data set to the specified abscissa. After calling this, the getOrdinateData() methods will return non-NULL pointers to the resampled ordinate data. If the range of the abscissa is greater than the range of the original abscissa, or if the resampling fails for any other reason, this method will fail and will leave the ordinate data unsampled.

Parameters:
abscissa The abscissa values to resample the ordinate data to. If this is empty, the ordinate data will not be resampled and getOrdinateData() will return NULL.
Returns:
True if resampling was successful, or false otherwise.
Subject Notifications:
This method will notify Subject::signalModified.

virtual void SignatureLibrary::desample (  )  [pure virtual]

Frees up all resources associated with resampling the library.

Frees up all resources associated with resampling the library. The library is restored to the state it was in immediately after being imported, but before being resampled.

Subject Notifications:
This method will notify Subject::signalModified.

virtual bool SignatureLibrary::import ( const std::string &  filename,
const std::string &  importerName,
Progress pProgress = NULL 
) [pure virtual]

Imports a new signature library file into the library object.

This method clears the SignatureLibrary and then imports a new library file into it. The library will be imported as an on-disk RasterElement and will be available via getOriginalOrdinateData().

Parameters:
filename The full pathname of the file to import.
importerName The name of the importer to use to import the library as an on-disk RasterElement.
pProgress The progress object to pass into the importer. If NULL is passed in, a progress object is obtained by calling PlugInManagerServices::getProgress().
Returns:
True if the import succeeded and false otherwise.
Subject Notifications:
This method will notify Subject::signalModified.
See also:
clear(), getOriginalOrdinateData()

virtual bool SignatureLibrary::insertSignature ( Signature pSignature  )  [pure virtual]

Adds an existing signature into the library.

Adds an existing signature into an empty library. If the library is not empty, this method will fail.

Parameters:
pSignature The signature to add to the library.
Returns:
True if the signature was successfully added to the library, otherwise false.
Subject Notifications:
This method will notify Subject::signalModified.

Implements SignatureSet.

virtual bool SignatureLibrary::insertSignatures ( const std::vector< Signature * > &  signatures  )  [pure virtual]

Adds several signatures to the library.

Adds several signatures into any empty library. The signatures must be unique. If any of the sigs to add are NULL, the method will fail, having done nothing. If the library is not empty, this method will fail.

Parameters:
signatures A vector of signatures to add to the library
Returns:
true if the signatures were added, otherwise false.
Subject Notifications:
This method will notify Subject::signalModified after the sigs are done being added to the list. Only one notification will be done. No notification will be done if signatures is empty.

Implements SignatureSet.

virtual bool SignatureLibrary::removeSignature ( Signature pSignature,
bool  bDelete = false 
) [pure virtual]

Removes a signature from the library.

Removes a signature from the library. This will only succeed if the signature is the only signature in the library.

Parameters:
pSignature The signature to remove from the library.
bDelete This value is ignored. If the method succeeds, the signatures will be deleted.
Returns:
True if the signature successfully removed from the library, otherwise false. False is also returned if the given signature does not exist in the library.
Subject Notifications:
This method will notify Subject::signalModified.

Implements SignatureSet.

virtual bool SignatureLibrary::removeSignatures ( const std::vector< Signature * > &  signatures,
bool  bDelete = false 
) [pure virtual]

Removes several signatures from the library.

This method removes several sigs from the library. The list must contain all of the sigs in the library or the method will fail. If the list of sigs to remove contains sigs not in the library, those sigs will be ignored.

Parameters:
signatures A vector of sigs to remove from the library
bDelete This value is ignored. If the method succeeds, the signatures will be deleted.
Returns:
Returns true if the list of signatures to remove was not empty and all of the specified signatures were found in the set; otherwise returns false.
Subject Notifications:
This method will notify Subject::signalModified after the signatures are done being removed from the list. Only one notification will be done.

Implements SignatureSet.

virtual void SignatureLibrary::clear ( bool  bDelete = false  )  [pure virtual]

Removes all of the signatures from the library.

This method removes all of the signatures from the library. The signatures will be deleted in the process.

Parameters:
bDelete This value is ignored. The signatures will be deleted.
Subject Notifications:
This method will notify Subject::signalModified after the signatures are done being removed from the library if the library was not empty. At most one notification will be done.

Implements SignatureSet.


Software Development Kit - Opticks 4.9.0 Build 16218