#include <SignatureLibrary.h>

Public Member Functions | |
| virtual const std::vector < double > & | getAbscissa () const =0 |
| virtual const std::vector < double > & | getOriginalAbscissa () const =0 |
| virtual const RasterElement * | getOriginalOrdinateData () const =0 |
| virtual RasterElement * | getOriginalOrdinateData ()=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 Signature * | getSignature (unsigned int index) const =0 |
| virtual const Signature * | getSignature (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 () |
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:
Definition at line 47 of file SignatureLibrary.h.
| virtual SignatureLibrary::~SignatureLibrary | ( | ) | [protected, virtual] |
This should be destroyed by calling ModelServices::destroyElement.
Definition at line 321 of file SignatureLibrary.h.
| 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().
| virtual const std::vector<double>& SignatureLibrary::getOriginalAbscissa | ( | ) | const [pure virtual] |
Returns the values that the raw signature library ordinate data is sampled to.
| virtual const RasterElement* SignatureLibrary::getOriginalOrdinateData | ( | ) | const [pure virtual] |
Returns the raw ordinate data.
The raw ordinate data is returned as an on-disk RasterElement.
| virtual RasterElement* SignatureLibrary::getOriginalOrdinateData | ( | ) | [pure virtual] |
Returns the raw ordinate data.
The raw ordinate data is returned as an on-disk RasterElement.
| 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.
| 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.
| index | The index of the signature for which the ordinate data is to be retrieved. |
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.
| virtual std::string SignatureLibrary::getSignatureName | ( | unsigned int | index | ) | const [pure virtual] |
Returns the name of the specified signature.
| index | The index of the signature for which the name is to be retrieved. |
| virtual const Signature* SignatureLibrary::getSignature | ( | unsigned int | index | ) | const [pure virtual] |
Returns the specified signature.
| index | The index of the signature to be retrieved. |
NULL if the index is invalid. | virtual const Signature* SignatureLibrary::getSignature | ( | const std::string & | name | ) | const [pure virtual] |
Returns the specified signature.
| name | The name of the signature to be retrieved. |
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.
| 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.
| 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. |
True if resampling was successful, or false otherwise.| 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.
| 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().
| 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(). |
True if the import succeeded and false otherwise.| 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.
| pSignature | The signature to add to the library. |
True if the signature was successfully added to the library, otherwise false.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.
| signatures | A vector of signatures to add to the library |
true if the signatures were added, otherwise false.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.
| pSignature | The signature to remove from the library. | |
| bDelete | This value is ignored. If the method succeeds, the signatures will be deleted. |
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.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.
| signatures | A vector of sigs to remove from the library | |
| bDelete | This value is ignored. If the method succeeds, the signatures will be deleted. |
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.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.
| bDelete | This value is ignored. The signatures will be deleted. |
Implements SignatureSet.