Noise Vector object. More...
#include "us_noise.h"
Public Types | |
enum | NoiseType { RI, TI } |
Types of noise: radially-invariant or time-invariant. More... | |
Public Member Functions | |
US_Noise () | |
Create a noise vector object. More... | |
int | load (bool, const QString &, US_DB2 *=0) |
int | load (const QString &, US_DB2 *) |
int | load (const QString &) |
bool | operator== (const US_Noise &) const |
Compare two noise objects for equality. More... | |
bool | operator!= (const US_Noise &n) const |
Compare two noise objects for non-equality. More... | |
int | write (bool, const QString &, US_DB2 *=0) |
int | write (US_DB2 *) |
int | write (const QString &) |
int | apply_to_data (US_DataIO::EditedData &, bool=true) |
bool | sum_noise (US_Noise, bool=false) |
Static Public Member Functions | |
static int | apply_noise (US_DataIO::EditedData &, US_Noise *=0, bool=true) |
static bool | noise_path (QString &) |
static bool | sum_noises (US_Noise &, US_Noise, bool=false) |
Public Attributes | |
NoiseType | type |
Type of noise: RI or TI. More... | |
QString | description |
String describing the noise set. More... | |
QString | noiseGUID |
Global ID of this noise. More... | |
QString | modelGUID |
Global ID of parent model object. More... | |
double | minradius |
Minimum radius value for TI type. More... | |
double | maxradius |
Maximum radius value for TI type. More... | |
int | count |
Number of noise values in the vector. More... | |
QVector< double > | values |
Vector of noise values. More... | |
QString | message |
Used internally for communication. More... | |
Private Member Functions | |
int | load_disk (const QString &) |
int | load_db (const QString &, US_DB2 *) |
int | load_stream (QXmlStreamReader &) |
void | write_stream (QXmlStreamWriter &) |
void | debug (void) |
Noise Vector object.
This class sets up a noise vector of time-invariant or radially-invariant values. It provides an interface to read and write values in the database or in local disk files.
Definition at line 17 of file us_noise.h.
enum US_Noise::NoiseType |
Types of noise: radially-invariant or time-invariant.
Enumerator | |
---|---|
RI | |
TI |
Definition at line 24 of file us_noise.h.
US_Noise::US_Noise | ( | ) |
Create a noise vector object.
Definition at line 11 of file us_noise.cpp.
|
static |
Static function to apply a noise vector to an EditedData set.
editdata | Reference to EditedData set to apply to. |
noise | Pointer to noise to apply to data (ti or ri). |
remove | Flag to remove (true) or add back (false) noise. |
Definition at line 281 of file us_noise.cpp.
int US_Noise::apply_to_data | ( | US_DataIO::EditedData & | editdata, |
bool | remove = true |
||
) |
Apply a noise vector to an EditedData set.
editdata | Reference to EditedData set to apply to. |
remove | Flag to remove (true) or add back (false) noise. |
Definition at line 221 of file us_noise.cpp.
|
private |
Definition at line 427 of file us_noise.cpp.
int US_Noise::load | ( | bool | db_access, |
const QString & | guid, | ||
US_DB2 * | db = 0 |
||
) |
Read a noise vector from the disk or database
db_access | A flag to indicate if the DB (true) or disk (false) should be searched for the noise vector |
guid | The guid of the noise vector to be loaded |
db | For DB access, pointer to an open database connection |
Definition at line 41 of file us_noise.cpp.
int US_Noise::load | ( | const QString & | id, |
US_DB2 * | db | ||
) |
An overloaded function to read a noise vector from a database
id | The DB ID of the desired Noise record |
db | A pointer to an open database connection |
Definition at line 48 of file us_noise.cpp.
int US_Noise::load | ( | const QString & | filename | ) |
An overloaded function to read a noise vector from the disk
filename | The name, including full path, of the noise XML file |
Definition at line 66 of file us_noise.cpp.
|
private |
Definition at line 367 of file us_noise.cpp.
|
private |
Definition at line 313 of file us_noise.cpp.
|
private |
Definition at line 82 of file us_noise.cpp.
|
static |
Static function to find and, if need be, create noise directory path.
path | A reference to the full disk path for the directory into which to write the noise vector file. |
Definition at line 296 of file us_noise.cpp.
|
inline |
Compare two noise objects for non-equality.
Definition at line 64 of file us_noise.h.
bool US_Noise::operator== | ( | const US_Noise & | n | ) | const |
Compare two noise objects for equality.
Definition at line 24 of file us_noise.cpp.
bool US_Noise::sum_noise | ( | US_Noise | noise2, |
bool | always_sum = false |
||
) |
Sum a second noise vector into a noise vector
noise2 | A second noise object to sum into current noise |
always_sum | Flag if summing should proceed even with mismatch |
Definition at line 446 of file us_noise.cpp.
Static function to sum two noise vectors
noise1 | A first noise object into which to sum a second |
noise2 | A second noise object to sum into the first |
always_sum | Flag if summing should proceed even with mismatch |
Definition at line 528 of file us_noise.cpp.
int US_Noise::write | ( | bool | db_access, |
const QString & | filename, | ||
US_DB2 * | db = 0 |
||
) |
Write a noise vector to the disk or database
db_access | A flag to indicate if the DB (true) or disk (false) should be used to save the noise vector |
filename | The filename (with path) where the xml file is to be written if disk access is specified |
db | For DB access, pointer to an open database connection |
Definition at line 128 of file us_noise.cpp.
int US_Noise::write | ( | US_DB2 * | db | ) |
An overloaded function to write a noise vector to the DB
db | A pointer to an open database connection |
Definition at line 135 of file us_noise.cpp.
int US_Noise::write | ( | const QString & | filename | ) |
An overloaded function to write a noise vector to a file on disk
filename | The filename to write |
Definition at line 206 of file us_noise.cpp.
|
private |
Definition at line 382 of file us_noise.cpp.
int US_Noise::count |
Number of noise values in the vector.
Definition at line 35 of file us_noise.h.
QString US_Noise::description |
String describing the noise set.
Definition at line 28 of file us_noise.h.
double US_Noise::maxradius |
Maximum radius value for TI type.
Definition at line 33 of file us_noise.h.
QString US_Noise::message |
Used internally for communication.
Definition at line 39 of file us_noise.h.
double US_Noise::minradius |
Minimum radius value for TI type.
Definition at line 32 of file us_noise.h.
QString US_Noise::modelGUID |
Global ID of parent model object.
Definition at line 30 of file us_noise.h.
QString US_Noise::noiseGUID |
Global ID of this noise.
Definition at line 29 of file us_noise.h.
NoiseType US_Noise::type |
Type of noise: RI or TI.
Definition at line 26 of file us_noise.h.
QVector< double > US_Noise::values |
Vector of noise values.
Definition at line 37 of file us_noise.h.