Brief description of class still missing. More...
#include <Mode.h>
Public Types | |
enum | Polarisation { Vertical = 1, Radial = 2, Rayleigh = 3, Transverse = 4, Love = 5 } |
enum | Slowness { Phase = 0, Group = 1 } |
Public Member Functions | |
int | index () const |
QString | indexString () const |
Mode () | |
Mode (Slowness s, Polarisation p, int index) | |
Mode (Polarisation p, int ringIndex, int index) | |
Mode (const Mode &o) | |
bool | operator== (const Mode &o) const |
Polarisation | polarisation () const |
QString | polarisationString () const |
int | ringIndex () const |
void | setIndex (int i) |
void | setPolarisation (Polarisation p) |
void | setPolarisation (QString p) |
void | setRingIndex (int i) |
void | setSlowness (Slowness s) |
void | setSlowness (QString s) |
Slowness | slowness () const |
QString | slownessString () const |
QString | toString () const |
virtual const QString & | xml_tagName () const |
Static Public Attributes | |
static const QString | xmlModeTag = "Mode" |
Protected Member Functions | |
XMLMember | xml_member (XML_MEMBER_ARGS) |
bool | xml_setProperty (XML_SETPROPERTY_ARGS) |
void | xml_writeProperties (XML_WRITEPROPERTIES_ARGS) const |
Brief description of class still missing.
Full description of class still missing
{Vertical=1, Radial=2, Rayleigh=3, Transverse=4, Love=5};
QGpCoreWave::Mode::Mode | ( | ) | [inline] |
QGpCoreWave::Mode::Mode | ( | Slowness | s, |
Polarisation | p, | ||
int | index | ||
) | [inline] |
QGpCoreWave::Mode::Mode | ( | Polarisation | p, |
int | ringIndex, | ||
int | index | ||
) | [inline] |
QGpCoreWave::Mode::Mode | ( | const Mode & | o | ) | [inline] |
int QGpCoreWave::Mode::index | ( | ) | const [inline] |
Referenced by QGpGuiWave::ModeItem::data(), Mode(), QGpCoreWave::EllipticityFactory::mode(), QGpCoreWave::DispersionFactory::mode(), QGpCoreWave::AutocorrFactory::mode(), DinverDCGui::AutocorrViewer::report2plot(), DinverDCGui::AutocorrViewer::setMode(), QGpCoreWave::EllipticityFactory::setMode(), QGpCoreWave::DispersionFactory::setMode(), QGpCoreWave::AutocorrFactory::setMode(), and DinverDCGui::AutocorrViewer::setSampleCount().
{return _index;}
QString QGpCoreWave::Mode::indexString | ( | ) | const |
Return a user-friendly string describing this mode index
References QGpCoreTools::tr(), and TRACE.
bool QGpCoreWave::Mode::operator== | ( | const Mode & | o | ) | const [inline] |
Polarisation QGpCoreWave::Mode::polarisation | ( | ) | const [inline] |
Referenced by main(), QGpCoreWave::DispersionFactory::mode(), QGpCoreWave::AutocorrFactory::mode(), DinverDCGui::DispersionViewer::seekMode(), QGpCoreWave::DispersionFactory::setMode(), and QGpCoreWave::AutocorrFactory::setMode().
{return _polarisation;}
QString QGpCoreWave::Mode::polarisationString | ( | ) | const |
Return a user-friendly string for polarisation
References Radial, QGpCoreTools::tr(), TRACE, Transverse, and Vertical.
Referenced by QGpGuiWave::ModeItem::data(), DinverDCGui::DispersionViewer::setMode(), and DinverDCGui::AutocorrViewer::setMode().
int QGpCoreWave::Mode::ringIndex | ( | ) | const [inline] |
Referenced by main(), Mode(), QGpCoreWave::AutocorrFactory::mode(), and QGpCoreWave::AutocorrFactory::setMode().
{return _ringIndex;}
void QGpCoreWave::Mode::setIndex | ( | int | i | ) | [inline] |
void QGpCoreWave::Mode::setPolarisation | ( | Polarisation | p | ) | [inline] |
Referenced by QGpGuiWave::ModeDelegate::defaultMode(), main(), QGpGuiWave::ModeItem::setData(), and TargetAdd::setOptions().
{_polarisation=p;}
void QGpCoreWave::Mode::setPolarisation | ( | QString | p | ) |
Set polarisatio from a user-friendly string
References Love, Radial, Rayleigh, QGpCoreTools::tr(), TRACE, Transverse, and Vertical.
void QGpCoreWave::Mode::setRingIndex | ( | int | i | ) | [inline] |
Referenced by QGpGuiWave::ModeDelegate::defaultMode(), and DinverDCGui::AutocorrViewer::setTarget().
{_ringIndex=i;}
void QGpCoreWave::Mode::setSlowness | ( | Slowness | s | ) | [inline] |
Referenced by QGpGuiWave::ModeDelegate::defaultMode(), main(), QGpGuiWave::ModeItem::setData(), and TargetAdd::setOptions().
{_slowness=s;}
void QGpCoreWave::Mode::setSlowness | ( | QString | s | ) |
Slowness QGpCoreWave::Mode::slowness | ( | ) | const [inline] |
Referenced by QGpCoreWave::DispersionFactory::mode(), DinverDCGui::DispersionViewer::seekMode(), and QGpCoreWave::DispersionFactory::setMode().
{return _slowness;}
QString QGpCoreWave::Mode::slownessString | ( | ) | const |
Return a user-friendly string for slowness
References QGpCoreTools::tr(), and TRACE.
Referenced by QGpGuiWave::ModeItem::data(), and DinverDCGui::DispersionViewer::setMode().
QString QGpCoreWave::Mode::toString | ( | ) | const |
Return a user-friendly string completely describing this mode
References Phase, Radial, str, QGpCoreTools::tr(), TRACE, Transverse, and Vertical.
{ TRACE; QString str; switch (_polarisation) { case Vertical: case Radial: case Transverse: str+=QString("Ring %1").arg(_ringIndex); break; case Love: case Rayleigh: switch (_slowness) { case Group: str+=tr("Group"); break; case Phase: str+=tr("Phase"); break; } } str+=" "; switch (_polarisation) { case Vertical: str+=tr("Vertical"); break; case Radial: str+=tr("Radial"); break; case Rayleigh: str+=tr("Rayleigh"); break; case Transverse: str+=tr("Transverse"); break; case Love: str+=tr("Love"); break; } str+=" "; switch (_index) { case 0: str+=tr("fundamental"); break; case 1: str+=tr("1st higher"); break; case 2: str+=tr("2nd higher"); break; case 3: str+=tr("3rd higher"); break; default: str+=tr("higher %1").arg(_index); break; } return str; }
XMLMember QGpCoreWave::Mode::xml_member | ( | XML_MEMBER_ARGS | ) | [protected, virtual] |
Re-implement this function to offer XML restore (children and properties) support to your class.
From tag and map (with contains the attibute value) return a unique identifier under the format of a XMLMember. XMLMember is initialized with 3 types of contructors:
Map of attributes can be inspected in this way (can be achived also in xml_setProperty()):
static const QString tmp("childrenName"); XMLRestoreAttributeIterator it=map.find(tmp); if(it!=map.end()) { // found attribute "childrenName" }
If the map of attributes is not used:
Q_UNUSED(attributes); if(tag=="x1") return XMLMember(0); else if(tag=="y1") return XMLMember(1); else if(tag=="x2") return XMLMember(2); else if(tag=="y2") return XMLMember(3); else return XMLMember(XMLMember::Unknown);
Arithmetic operations + and - apply to XMLMember to avoid confusion of property id numbers between inherited objects. Offset 3 corresponds to the number of properties defined in this object.
if(tag=="anInteger") return XMLMember(0); else if(tag=="aString") return XMLMember(1); else if(tag=="aDouble") return XMLMember(2); return AbstractLine::xml_member(tag, attributes, context)+3;
For the arguments of this function use Macro XML_MEMBER_ARGS.
Reimplemented from QGpCoreTools::XMLClass.
References TRACE.
bool QGpCoreWave::Mode::xml_setProperty | ( | XML_SETPROPERTY_ARGS | ) | [protected, virtual] |
Re-implement this function to offer XML restore properties support to your class.
From memberID set the corresponding property with value content. The map of attributes is given as a supplementary information (not useful in all cases).
For a general case:
Q_UNUSED(attributes); double val=content.toDouble(); switch (memberID) { case 0: _x1=val; return true; case 1: _y1=val; return true; case 2: _x2=val; return true; case 3: _y2=val; return true; default: return false; }
For classes inheriting other classes (see also xml_member())
switch (memberID) { case 0: _anInteger=content.toString(); return true; case 1: _aString=content.toInt(); return true; case 2: _aDouble=content.toDouble(); return true; default: return AbstractLine::xml_setProperty(memberID-3, map, content);
For the arguments of this function use Macro XML_SETPROPERTY_ARGS.
Reimplemented from QGpCoreTools::XMLClass.
References Group, Love, Phase, Radial, Rayleigh, TRACE, Transverse, and Vertical.
{ TRACE; Q_UNUSED(tag); Q_UNUSED(attributes) Q_UNUSED(context); switch (memberID) { case 0: if(content=="Group") _slowness=Group; else _slowness=Phase; return true; case 1: if(content=="Rayleigh") _polarisation=Rayleigh; else if(content=="Love") _polarisation=Love; else if(content=="Vertical") _polarisation=Vertical; else if(content=="Radial") _polarisation=Radial; else if(content=="Transverse") _polarisation=Transverse; else return false; return true; case 2: _ringIndex=content.toInt(); return true; case 3: _index=content.toInt(); return true; default: return false; } }
virtual const QString& QGpCoreWave::Mode::xml_tagName | ( | ) | const [inline, virtual] |
Implements QGpCoreTools::XMLClass.
{return xmlModeTag;}
void QGpCoreWave::Mode::xml_writeProperties | ( | XML_WRITEPROPERTIES_ARGS | ) | const [protected, virtual] |
Reimplemented from QGpCoreTools::XMLClass.
References Phase, Radial, TRACE, Transverse, Vertical, and QGpCoreTools::XMLClass::writeProperty().
{ TRACE; Q_UNUSED(context); switch (_slowness) { case Group: writeProperty(s,"slowness", "Group"); break; case Phase: writeProperty(s,"slowness", "Phase"); break; } switch (_polarisation) { case Vertical: writeProperty(s,"polarisation","Vertical"); break; case Radial: writeProperty(s,"polarisation","Radial"); break; case Rayleigh: writeProperty(s,"polarisation","Rayleigh"); break; case Transverse: writeProperty(s,"polarisation","Transverse"); break; case Love: writeProperty(s,"polarisation","Love"); break; } writeProperty(s,"ringIndex",_ringIndex); writeProperty(s,"index",_index); }
const QString QGpCoreWave::Mode::xmlModeTag = "Mode" [static] |