Brief description of class still missing. More...
#include <ParamLayer.h>
Public Types | |
enum | Shape { Uniform, Linear, LinearIncrease, LinearDecrease, PowerLaw } |
Public Member Functions | |
double | bottomDepth () const |
double | bottomMaximumValue () const |
double | bottomMinimumValue () const |
Parameter * | bottomParam () const |
void | collectValueParameters (QList< Parameter * > ¶ms) const |
bool | depthToParam (bool last, ParamLayer *prev, RealSpace &ps, const ParamGroundModel *groundModel) |
Parameter * | dhParam () const |
double | fixedBottomDepth () const |
int | index () const |
bool | isDepth () const |
bool | isLastParamCondition () const |
bool | isLinkedTo (ParamLayer *o) |
bool | isUniformShape () |
const QString & | linkedTo () const |
double | maximumDepth () const |
double | minimumDepth () const |
QString | name () const |
int | nSubLayers () const |
ParamLayer (const ParamLayer &o) | |
ParamLayer (ParamProfile *profile, int index) | |
ParamLayer (ParamProfile *profile, int index, double minValue, double maxValue, ParamProfile *linkedTo) | |
ParamLayer (ParamProfile *profile, int index, double minValue, double maxValue, double minDepth, double maxDepth) | |
ParamProfile * | profile () const |
void | setBottomMaximumValue (double v) |
void | setBottomMinimumValue (double v) |
void | setDepth (bool d) |
void | setFinalDepths (double &z) |
void | setFinalProfileDepthsCondition (Profile &min, Profile &max, double &z) |
void | setFinalProfileDepthsParam (Profile &profile, double &z) |
void | setFinalProfileValuesCondition (Profile &min, Profile &max) |
void | setFinalProfileValuesParam (Profile &profile) |
void | setIndex (int i) |
void | setLastParamCondition (bool c) |
void | setLinkedDepth (bool last, ParamLayer *prev, RealSpace &ps) |
void | setLinkedTo (const QString &l) |
void | setLinkedTo () |
void | setMaximumDepth (double v) |
void | setMinimumDepth (double v) |
void | setNSubLayers (int n) |
void | setProfile (ParamProfile *p) |
void | setPtrLink (ParamLayer *layer) |
void | setShape (Shape s) |
void | setTopDepthIndex (int &index) |
void | setTopMaximumValue (double v) |
void | setTopMinimumValue (double v) |
Shape | shape () const |
double | topDepth () const |
int | topDepthIndex () const |
double | topMaximumValue () const |
double | topMinimumValue () const |
Parameter * | topParam () const |
QString | unit () const |
bool | valueToParam (RealSpace &ps, const ParamGroundModel *groundModel) |
virtual const QString & | xml_tagName () const |
Static Public Member Functions | |
static QString | name (QString profileShortName, int index) |
Static Public Attributes | |
static const QString | xmlParamLayerTag = "ParamLayer" |
Protected Member Functions | |
double | fixedThickness (ParamLayer *&ref) |
void | setFinalProfileValues (Profile &profile, double topV, double bottomV) |
virtual XMLMember | xml_member (XML_MEMBER_ARGS) |
virtual bool | xml_setProperty (XML_SETPROPERTY_ARGS) |
virtual void | xml_writeProperties (XML_WRITEPROPERTIES_ARGS) const |
Protected Attributes | |
double | _bottomMax |
double | _bottomMin |
Parameter * | _bottomP |
double | _dhMax |
double | _dhMin |
Parameter * | _dhP |
double | _finalBottomDepth |
double | _finalTopDepth |
int | _index |
bool | _isDepth |
bool | _lastParamCondition |
QString | _linkedTo |
int | _nSubLayers |
ParamProfile * | _profile |
ParamLayer * | _ptrLink |
Shape | _shape |
int | _topDepthIndex |
double | _topMax |
double | _topMin |
Parameter * | _topP |
Brief description of class still missing.
Full description of class still missing
DinverDCCore::ParamLayer::ParamLayer | ( | const ParamLayer & | o | ) |
Copy constructor. Profile ownership is left free. Used only by copy constructor of ParamProfile.
References _bottomMax, _bottomMin, _bottomP, _dhMax, _dhMin, _dhP, _finalBottomDepth, _finalTopDepth, _index, _isDepth, _lastParamCondition, _linkedTo, _nSubLayers, _profile, _ptrLink, _shape, _topDepthIndex, _topMax, _topMin, and _topP.
: XMLClass() { _profile=0; _index=o._index; _shape=o._shape; _nSubLayers=o._nSubLayers; _topMin=o._topMin; _topMax=o._topMax; _bottomMin=o._bottomMin; _bottomMax=o._bottomMax; _lastParamCondition=o._lastParamCondition; _linkedTo=o._linkedTo; _isDepth=o._isDepth; _dhMin=o._dhMin; _dhMax=o._dhMax; _topDepthIndex=o._topDepthIndex; _finalTopDepth=o._finalTopDepth; _finalBottomDepth=o._finalBottomDepth; _ptrLink=0; _topP=0; _bottomP=0; _dhP=0; }
DinverDCCore::ParamLayer::ParamLayer | ( | ParamProfile * | profile, |
int | index | ||
) |
Constructs a default layer. Default options are acquired from profile.
References _bottomMax, _bottomMin, _bottomP, _dhMax, _dhMin, _dhP, _index, _isDepth, _lastParamCondition, _linkedTo, _nSubLayers, _profile, _ptrLink, _shape, _topDepthIndex, _topMax, _topMin, _topP, DinverDCCore::ParamProfile::defaultMaximum(), DinverDCCore::ParamProfile::defaultMinimum(), index(), profile(), TRACE, and Uniform.
{ TRACE; _profile=profile; _index=index; _shape=Uniform; _nSubLayers=5; _topMin=profile->defaultMinimum(); _topMax=profile->defaultMaximum(); _bottomMin=_topMin; _bottomMax=_topMax; _lastParamCondition=true; _linkedTo="Not linked"; _isDepth=true; _dhMin=1.0; _dhMax=100.0; _topDepthIndex=0; _ptrLink=0; _topP=0; _bottomP=0; _dhP=0; }
DinverDCCore::ParamLayer::ParamLayer | ( | ParamProfile * | profile, |
int | index, | ||
double | minValue, | ||
double | maxValue, | ||
ParamProfile * | linkedTo | ||
) |
Create a new layer with a uniform value between minValue and maxValue. The detph is linked to profile linkedTo. Basically used to build a ground model from a Seismic1DModel.
References _bottomMax, _bottomMin, _bottomP, _dhMax, _dhMin, _dhP, _index, _isDepth, _lastParamCondition, _linkedTo, _nSubLayers, _profile, _ptrLink, _shape, _topDepthIndex, _topMax, _topMin, _topP, index(), name(), profile(), DinverDCCore::ParamProfile::shortName(), TRACE, and Uniform.
{ TRACE; _profile=profile; _index=index; _ptrLink=0; _topP=0; _bottomP=0; _dhP=0; _topDepthIndex=0; _shape=Uniform; _lastParamCondition=false; _nSubLayers=1; _topMin=minValue; _topMax=maxValue; _bottomMin=minValue; _bottomMax=maxValue; _linkedTo=name(linkedTo->shortName(), index); _isDepth=true; _dhMin=0.0; _dhMax=0.0; }
DinverDCCore::ParamLayer::ParamLayer | ( | ParamProfile * | profile, |
int | index, | ||
double | minValue, | ||
double | maxValue, | ||
double | minDepth, | ||
double | maxDepth | ||
) |
Create a new layer with a uniform value betweem minValue and maxValue. The detph can vary from minDepth to maxDepth. Basically used to build a ground model from a Seismic1DModel.
References _bottomMax, _bottomMin, _bottomP, _dhMax, _dhMin, _dhP, _index, _isDepth, _lastParamCondition, _linkedTo, _nSubLayers, _profile, _ptrLink, _shape, _topDepthIndex, _topMax, _topMin, _topP, index(), profile(), TRACE, and Uniform.
{ TRACE; _profile=profile; _index=index; _ptrLink=0; _topP=0; _bottomP=0; _dhP=0; _topDepthIndex=0; _shape=Uniform; _lastParamCondition=false; _nSubLayers=1; _topMin=minValue; _topMax=maxValue; _bottomMin=minValue; _bottomMax=maxValue; _linkedTo="Not linked"; _isDepth=true; _dhMin=minDepth; _dhMax=maxDepth; }
DinverDCCore::ParamLayer::bottomDepth | ( | ) | const [inline] |
Returns the current depth of the bottom
Referenced by fixedBottomDepth(), and DinverDCCore::PoissonCondition::getLimits().
{return _finalBottomDepth;}
double DinverDCCore::ParamLayer::bottomMaximumValue | ( | ) | const [inline] |
Referenced by ParamLayerWidget::setFrom().
{return _bottomMax;}
double DinverDCCore::ParamLayer::bottomMinimumValue | ( | ) | const [inline] |
Referenced by ParamLayerWidget::paramLayer(), and ParamLayerWidget::setFrom().
{return _bottomMin;}
Parameter* DinverDCCore::ParamLayer::bottomParam | ( | ) | const [inline] |
Referenced by DinverDCCore::ParamProfile::toParam().
{return _bottomP;}
void DinverDCCore::ParamLayer::collectValueParameters | ( | QList< Parameter * > & | params | ) | const |
Add top and bottom parameters if they are not fixed to params.
References _bottomP, _topP, DinverCore::Parameter::isFixed(), and TRACE.
Referenced by DinverDCCore::ParamProfile::collectValueParameters().
bool DinverDCCore::ParamLayer::depthToParam | ( | bool | last, |
ParamLayer * | prev, | ||
RealSpace & | ps, | ||
const ParamGroundModel * | groundModel | ||
) |
References _dhMax, _dhMin, _dhP, _isDepth, _ptrLink, DinverCore::RealSpace::addCondition(), DinverCore::RealSpace::addParameter(), DinverDCCore::GroundParameter::Depth, dhParam(), DinverCore::Parameter::initGrid(), isDepth(), DinverCore::Parameter::setFussy(), DinverCore::Parameter::setPrecision(), DinverCore::Parameter::setScale(), DinverDCCore::GroundParameter::Thickness, and TRACE.
Referenced by DinverDCCore::ParamProfile::toParam().
{ TRACE; if(!_ptrLink && !last) { _dhP=ps.addParameter(new GroundParameter(groundModel, this, _isDepth ? GroundParameter::Depth : GroundParameter::Thickness, _dhMin, _dhMax) ); _dhP->setScale(ParameterGrid::Log); _dhP->setPrecision(0.01); if(!_dhP->initGrid()) { return false; } _dhP->setFussy(true); if (_isDepth && prev && prev->isDepth() && prev->dhParam()) { // Strict condition to avoid null thicknesses //ps.addCondition(new SimpleCondition (_dhP, SimpleCondition::GreaterThan, 1.0, prev->dhParam(), 0.0 )); // Condition to avoid thin layers: thickness cannot be less than 5% of average depth of layer ps.addCondition(new SimpleCondition (_dhP, SimpleCondition::GreaterThan, (2.0+0.05)/(2.0-0.05), prev->dhParam(), 0.0)); } } else { _dhP=0; } return true; }
Parameter* DinverDCCore::ParamLayer::dhParam | ( | ) | const [inline] |
Referenced by depthToParam().
{return _dhP;}
double DinverDCCore::ParamLayer::fixedBottomDepth | ( | ) | const |
Returns the current depth of next fixed depth. If the next layers have thickness parameters rather than depth, then the returned value is the bottom of the layer with a depth parameter below these thickness parameter layers, or 1e99 if the half space is reached. If the next layer has a depth parameter, the returned value is the same as bottomDepth().
References _index, bottomDepth(), isDepth(), DinverDCCore::ParamProfile::layer(), DinverDCCore::ParamProfile::nLayers(), profile(), and TRACE.
Referenced by DinverDCCore::PoissonCondition::isOk().
{ TRACE; int nLayers=profile()->nLayers(); for(int i=_index+1; i<nLayers; i++) { ParamLayer * layer=profile()->layer(i); if(layer->isDepth()) { return layer->bottomDepth(); } } return 1e99; // No fixed bottom depth, half space reached }
double DinverDCCore::ParamLayer::fixedThickness | ( | ParamLayer *& | ref | ) | [protected] |
Return the fixed thickness to the upper most layers with variable depth or thickness returned in ref (left)
References _dhMax, _dhMin, _index, _isDepth, _profile, fixedThickness(), DinverDCCore::ParamProfile::layer(), and TRACE.
Referenced by fixedThickness(), and isLinkedTo().
int DinverDCCore::ParamLayer::index | ( | ) | const [inline] |
Referenced by ParamLayer(), setTopDepthIndex(), and DinverDCCore::ParamGroundModel::updateFinalProfiles().
{return _index;}
bool DinverDCCore::ParamLayer::isDepth | ( | ) | const [inline] |
Referenced by depthToParam(), fixedBottomDepth(), and ParamLayerWidget::setFrom().
{return _isDepth;}
bool DinverDCCore::ParamLayer::isLastParamCondition | ( | ) | const [inline] |
Referenced by ParamLayerWidget::setFrom(), and DinverDCCore::ParamProfile::toParam().
{return _lastParamCondition;}
bool DinverDCCore::ParamLayer::isLinkedTo | ( | ParamLayer * | o | ) |
Check if the two layers have a common interface, even through fixed depths and thicknesses
References _ptrLink, fixedThickness(), isLinkedTo(), and TRACE.
Referenced by isLinkedTo().
{ TRACE; // layers are linked together (this towards o) if(_ptrLink==o) return true; // layers are both linked to another layer (chained links have already been solved) if(_ptrLink==o->_ptrLink && _ptrLink!=0) return true; // layers are linked together (o towards this) if(this==o->_ptrLink) return true; // layers have fixed depths or thicknesses ParamLayer * lThis, *lo; double thickness=fixedThickness(lThis); if(thickness==o->fixedThickness(lo) && thickness>0.0) { if(lThis && lo) { if(!lThis->isLinkedTo(lo)) return false; } else if( !lThis && !lo); else return false; } else return false; return true; }
bool DinverDCCore::ParamLayer::isUniformShape | ( | ) | [inline] |
const QString& DinverDCCore::ParamLayer::linkedTo | ( | ) | const [inline] |
Referenced by DinverDCCore::ParamProfile::setDepthLinks(), ParamLayerWidget::setLinksFrom(), and DinverDCCore::ParamProfile::toParam().
{return _linkedTo;}
double DinverDCCore::ParamLayer::maximumDepth | ( | ) | const [inline] |
Referenced by ParamLayerWidget::setFrom().
{return _dhMax;}
double DinverDCCore::ParamLayer::minimumDepth | ( | ) | const [inline] |
Referenced by ParamLayerWidget::paramLayer(), and ParamLayerWidget::setFrom().
{return _dhMin;}
QString DinverDCCore::ParamLayer::name | ( | ) | const |
References _index, _profile, DinverDCCore::ParamProfile::shortName(), and TRACE.
Referenced by DinverDCCore::ParamProfile::collectDepthLinks(), ParamLayer(), setFinalDepths(), setLinkedTo(), and DinverDCCore::ParamProfile::toParam().
QString DinverDCCore::ParamLayer::name | ( | QString | profileShortName, |
int | index | ||
) | [inline, static] |
int DinverDCCore::ParamLayer::nSubLayers | ( | ) | const [inline] |
Referenced by ParamLayerWidget::setFrom().
{return _nSubLayers;}
ParamProfile* DinverDCCore::ParamLayer::profile | ( | ) | const [inline] |
void DinverDCCore::ParamLayer::setBottomMaximumValue | ( | double | v | ) | [inline] |
Referenced by main(), and ParamLayerWidget::paramLayer().
{_bottomMax=v;}
void DinverDCCore::ParamLayer::setBottomMinimumValue | ( | double | v | ) | [inline] |
Referenced by main(), and ParamLayerWidget::paramLayer().
{_bottomMin=v;}
void DinverDCCore::ParamLayer::setDepth | ( | bool | d | ) | [inline] |
Referenced by main(), and ParamLayerWidget::paramLayer().
{_isDepth=d;}
void DinverDCCore::ParamLayer::setFinalDepths | ( | double & | z | ) |
Called routinely during inversion, it inits the final bottom depth of the layer.
If the top of the layer is below the bottom, a quasi null thickness is set. This may happen only during initialization phase. At any other time, the conditions on depths must effectively forbid this situation.
Links are not taken into account.
References _dhP, _finalBottomDepth, _finalTopDepth, _isDepth, QGpCoreTools::endl(), name(), DinverCore::Parameter::realValue(), QGpCoreTools::tr(), and TRACE.
{ TRACE; if(_dhP) { _finalTopDepth=z; if(_isDepth) { _finalBottomDepth=_dhP->realValue(); if(_finalTopDepth >= _finalBottomDepth) { App::stream() << tr("Null or negative thickness for layer %1: top=%2, bottom=%3, very thin layer instead (1 mm).") .arg(name()).arg(_finalTopDepth).arg(_finalBottomDepth) << endl; _finalBottomDepth=_finalTopDepth + 0.001; } z=_finalBottomDepth; } else { _finalBottomDepth=z + _dhP->realValue(); z=_finalBottomDepth; } } }
void DinverDCCore::ParamLayer::setFinalProfileDepthsCondition | ( | Profile & | min, |
Profile & | max, | ||
double & | z | ||
) |
Called routinely during inversion, it sets the depths of final profiles min and max for condition layers
References _dhP, _finalBottomDepth, _finalTopDepth, _nSubLayers, _ptrLink, _shape, _topDepthIndex, Linear, LinearDecrease, LinearIncrease, PowerLaw, QGpCoreWave::Profile::setDepth(), TRACE, and Uniform.
{ TRACE; if( !_dhP) { // Set final depth for halfspace or layers linked to thickness param _finalTopDepth=z; if(_ptrLink) _finalBottomDepth=_ptrLink->_finalBottomDepth; else _finalBottomDepth=1e99; } z=_finalBottomDepth; switch (_shape) { case Uniform: min.setDepth(_topDepthIndex, _finalBottomDepth); max.setDepth(_topDepthIndex, _finalBottomDepth); break; case Linear: case LinearIncrease: case LinearDecrease: { double dz=(_finalBottomDepth - _finalTopDepth)/(double) _nSubLayers; int n=_nSubLayers-1; for(int i=0;i < n;i++ ) { int di=_topDepthIndex+i; double z=_finalTopDepth + (double) (i + 1) * dz; min.setDepth(di, z); max.setDepth(di, z); } min.setDepth(_topDepthIndex+n, _finalBottomDepth); max.setDepth(_topDepthIndex+n, _finalBottomDepth); } break; case PowerLaw: { double dz=(_finalBottomDepth - _finalTopDepth)/(pow( 2.0, _nSubLayers) - 1.0); double z=_finalTopDepth; int n=_nSubLayers-1; for(int i=0;i < n;i++ ) { int di=_topDepthIndex+i; z += dz; min.setDepth(di, z); max.setDepth(di, z); dz *= 2.0; } min.setDepth(_topDepthIndex+n, _finalBottomDepth); max.setDepth(_topDepthIndex+n, _finalBottomDepth); } break; } }
void DinverDCCore::ParamLayer::setFinalProfileDepthsParam | ( | Profile & | profile, |
double & | z | ||
) |
Called routinely during inversion, it sets the depths of final profile for parameter layers
References _dhP, _finalBottomDepth, _finalTopDepth, _nSubLayers, _ptrLink, _shape, _topDepthIndex, Linear, LinearDecrease, LinearIncrease, PowerLaw, QGpCoreWave::Profile::setDepth(), TRACE, and Uniform.
{ TRACE; if( !_dhP) { // Set final depth for halfspace or layers linked to thickness param _finalTopDepth=z; if(_ptrLink) _finalBottomDepth=_ptrLink->_finalBottomDepth; else _finalBottomDepth=1e99; } z=_finalBottomDepth; switch (_shape) { case Uniform: profile.setDepth(_topDepthIndex, _finalBottomDepth); break; case Linear: case LinearIncrease: case LinearDecrease: { double dz=(_finalBottomDepth - _finalTopDepth)/(double) _nSubLayers; int n=_nSubLayers-1; for(int i=0;i < n;i++ ) { profile.setDepth(_topDepthIndex+i, _finalTopDepth + (double) (i + 1) * dz); } profile.setDepth(_topDepthIndex+n, _finalBottomDepth); } break; case PowerLaw: { double dz=(_finalBottomDepth - _finalTopDepth)/(pow( 2.0, _nSubLayers) - 1.0); double z=_finalTopDepth; int n=_nSubLayers-1; for(int i=0;i < n;i++ ) { z += dz; profile.setDepth(_topDepthIndex+i, z); dz *= 2.0; } profile.setDepth(_topDepthIndex+n, _finalBottomDepth); } break; } }
void DinverDCCore::ParamLayer::setFinalProfileValues | ( | Profile & | profile, |
double | topV, | ||
double | bottomV | ||
) | [protected] |
Set intermediate depths according to shape
References _finalBottomDepth, _finalTopDepth, _nSubLayers, _shape, _topDepthIndex, QGpCoreWave::Profile::depths(), Linear, LinearDecrease, LinearIncrease, QGpCoreTools::log(), PowerLaw, QGpCoreWave::Profile::setValue(), TRACE, and Uniform.
Referenced by setFinalProfileValuesCondition(), and setFinalProfileValuesParam().
{ TRACE; // TODO : titled layers switch (_shape) { case Uniform: profile.setValue(_topDepthIndex, topV); break; case Linear: case LinearIncrease: case LinearDecrease: { double h=_finalBottomDepth - _finalTopDepth; double dz=h/(double) _nSubLayers; double halfdz=0.5 * dz + _finalTopDepth; double slope=(bottomV - topV)/h; for(int i=0;i < _nSubLayers;i++ ) { int di=_topDepthIndex+i; profile.setValue(di, topV + slope * (profile.depths().at(di) - halfdz)); } } break; case PowerLaw: { // Simple power law: V=V0*(1.0+z-z0)^alpha double alpha=log(bottomV/topV)/log(_finalBottomDepth - _finalTopDepth + 1.0); double lastZ=_finalTopDepth; double z; for(int i=0;i < _nSubLayers;i++ ) { int di=_topDepthIndex+i; z=profile.depths().at(di); profile.setValue(di, topV * pow(1.0 + 0.5 * (z + lastZ) - _finalTopDepth, alpha) ); lastZ=z; } } break; } }
void DinverDCCore::ParamLayer::setFinalProfileValuesCondition | ( | Profile & | min, |
Profile & | max | ||
) | [inline] |
References _bottomMax, _bottomMin, _topMax, _topMin, setFinalProfileValues(), and TRACE.
Referenced by DinverDCCore::ParamProfile::toParam().
{ TRACE; setFinalProfileValues(min, _topMin, _bottomMin); setFinalProfileValues(max, _topMax, _bottomMax); }
void DinverDCCore::ParamLayer::setFinalProfileValuesParam | ( | Profile & | profile | ) | [inline] |
References _bottomP, _topP, DinverCore::Parameter::realValue(), setFinalProfileValues(), and TRACE.
void DinverDCCore::ParamLayer::setIndex | ( | int | i | ) | [inline] |
Referenced by DinverDCCore::ParamProfile::insertLayer().
{_index=i;}
void DinverDCCore::ParamLayer::setLastParamCondition | ( | bool | c | ) | [inline] |
Referenced by ParamLayerWidget::paramLayer().
{_lastParamCondition= c;}
void DinverDCCore::ParamLayer::setLinkedDepth | ( | bool | last, |
ParamLayer * | prev, | ||
RealSpace & | ps | ||
) |
Check and add condition for depth across linked depths.
References _dhP, _isDepth, _ptrLink, DinverCore::RealSpace::addCondition(), and TRACE.
Referenced by DinverDCCore::ParamProfile::setLinkedDepth().
{ TRACE; if(_ptrLink && !last) { static_cast<GroundParameter *>(_ptrLink->_dhP)->addLayer(this); if(_ptrLink->_isDepth) { _isDepth=true; _dhP=_ptrLink->_dhP; if(prev && prev->_isDepth && prev->_dhP) ps.addCondition(new SimpleCondition (_dhP, SimpleCondition::GreaterThan, 1.0, prev->_dhP, 0.0) ); } } // In case of thickness linked: _dhLeftP and _dhRightP pointers are set to 0 }
void DinverDCCore::ParamLayer::setLinkedTo | ( | const QString & | l | ) | [inline] |
Referenced by ParamLayerWidget::paramLayer(), and DinverDCCore::ParamProfile::setDepthLinkNames().
{_linkedTo=l;}
void DinverDCCore::ParamLayer::setMaximumDepth | ( | double | v | ) | [inline] |
Referenced by main(), and ParamLayerWidget::paramLayer().
{_dhMax=v;}
void DinverDCCore::ParamLayer::setMinimumDepth | ( | double | v | ) | [inline] |
Referenced by main(), and ParamLayerWidget::paramLayer().
{_dhMin=v;}
void DinverDCCore::ParamLayer::setNSubLayers | ( | int | n | ) | [inline] |
Referenced by ParamLayerWidget::paramLayer().
{_nSubLayers=n;}
void DinverDCCore::ParamLayer::setProfile | ( | ParamProfile * | p | ) | [inline] |
Referenced by DinverDCCore::ParamProfile::ParamProfile().
{_profile=p;}
void DinverDCCore::ParamLayer::setPtrLink | ( | ParamLayer * | layer | ) | [inline] |
Referenced by DinverDCCore::ParamProfile::setDepthLinks(), and DinverDCCore::ParamProfile::toParam().
{_ptrLink=layer;}
void DinverDCCore::ParamLayer::setShape | ( | Shape | s | ) | [inline] |
Referenced by main(), and ParamLayerWidget::paramLayer().
{_shape=s;}
void DinverDCCore::ParamLayer::setTopDepthIndex | ( | int & | index | ) |
Set the index of the top sub layer in the final profile, index is incremented by the number of sub layers for this layer.
References _nSubLayers, _shape, _topDepthIndex, index(), Linear, LinearDecrease, LinearIncrease, PowerLaw, and TRACE.
{ TRACE; _topDepthIndex=index; switch (_shape) { case Linear: case LinearIncrease: case LinearDecrease: case PowerLaw: index+=_nSubLayers; break; default: index++; break; } }
void DinverDCCore::ParamLayer::setTopMaximumValue | ( | double | v | ) | [inline] |
Referenced by main(), ParamLayerWidget::paramLayer(), and Model2ParamReader::parse().
{_topMax=v;}
void DinverDCCore::ParamLayer::setTopMinimumValue | ( | double | v | ) | [inline] |
Referenced by main(), ParamLayerWidget::paramLayer(), and Model2ParamReader::parse().
{_topMin=v;}
Shape DinverDCCore::ParamLayer::shape | ( | ) | const [inline] |
Referenced by ParamLayerWidget::setFrom().
{return _shape;}
DinverDCCore::ParamLayer::topDepth | ( | ) | const [inline] |
Returns the current depth of the top
Referenced by DinverDCCore::PoissonCondition::getLimits(), and DinverDCCore::PoissonCondition::isOk().
{return _finalTopDepth;}
int DinverDCCore::ParamLayer::topDepthIndex | ( | ) | const [inline] |
{return _topDepthIndex;}
double DinverDCCore::ParamLayer::topMaximumValue | ( | ) | const [inline] |
Referenced by ParamLayerWidget::setFrom().
{return _topMax;}
double DinverDCCore::ParamLayer::topMinimumValue | ( | ) | const [inline] |
Referenced by ParamLayerWidget::paramLayer(), Model2ParamReader::parse(), and ParamLayerWidget::setFrom().
{return _topMin;}
Parameter* DinverDCCore::ParamLayer::topParam | ( | ) | const [inline] |
Referenced by DinverDCCore::ParamProfile::toParam().
{return _topP;}
QString DinverDCCore::ParamLayer::unit | ( | ) | const |
bool DinverDCCore::ParamLayer::valueToParam | ( | RealSpace & | ps, |
const ParamGroundModel * | groundModel | ||
) |
References _bottomMax, _bottomMin, _bottomP, _shape, _topMax, _topMin, _topP, DinverCore::RealSpace::addCondition(), DinverCore::RealSpace::addParameter(), DinverCore::Parameter::initGrid(), Linear, LinearDecrease, LinearIncrease, PowerLaw, DinverCore::Parameter::setPrecision(), DinverCore::Parameter::setScale(), TRACE, Uniform, DinverDCCore::GroundParameter::ValueBottom, and DinverDCCore::GroundParameter::ValueTop.
Referenced by DinverDCCore::ParamProfile::toParam().
{ TRACE; _topP=ps.addParameter(new GroundParameter(groundModel, this, GroundParameter::ValueTop, _topMin, _topMax)); _topP->setScale(ParameterGrid::Log); _topP->setPrecision(0.01); if(!_topP->initGrid()) { return false; } switch (_shape) { case Uniform: _bottomP=_topP; break; case Linear: _bottomP=ps.addParameter(new GroundParameter(groundModel, this, GroundParameter::ValueBottom, _bottomMin, _bottomMax)); _bottomP->setScale(ParameterGrid::Log); _bottomP->setPrecision(0.01); if(!_bottomP->initGrid()) { return false; } break; case PowerLaw: case LinearIncrease: _bottomP=ps.addParameter(new GroundParameter(groundModel, this, GroundParameter::ValueBottom, _bottomMin, _bottomMax)); _bottomP->setScale(ParameterGrid::Log); _bottomP->setPrecision(0.01); if(!_bottomP->initGrid()) { return false; } ps.addCondition(new SimpleCondition (_bottomP, SimpleCondition::GreaterThan, 1.0, _topP, 0.0) ); break; case LinearDecrease: _bottomP=ps.addParameter(new GroundParameter(groundModel, this, GroundParameter::ValueBottom, _bottomMin, _bottomMax)); _bottomP->setScale(ParameterGrid::Log); _bottomP->setPrecision(0.01); if(!_bottomP->initGrid()) { return false; } ps.addCondition(new SimpleCondition (_bottomP, SimpleCondition::LessThan, 1.0, _topP, 0.0) ); break; } return true; }
XMLMember DinverDCCore::ParamLayer::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.
{ TRACE; Q_UNUSED(attributes) Q_UNUSED(context); if(tag=="shape" ) return XMLMember(0); else if(tag=="lastParamCondition" ) return XMLMember(1); else if(tag=="nSubayers" ) return XMLMember(2); else if(tag=="topMin" ) return XMLMember(3); else if(tag=="topMax" ) return XMLMember(4); else if(tag=="bottomMin" ) return XMLMember(5); else if(tag=="bottomMax" ) return XMLMember(6); else if(tag=="linkedTo" ) return XMLMember(7); else if(tag=="isDepth" ) return XMLMember(8); else if(tag=="dhMin" ) return XMLMember(9); else if(tag=="dhMax" ) return XMLMember(10); else if(tag=="tilted" ) return XMLMember(11); // Kept for compatibility else if(tag=="dhMinLeft" ) return XMLMember(9); // Kept for compatibility else if(tag=="dhMaxLeft" ) return XMLMember(10); // Kept for compatibility else if(tag=="dhMinRight" ) return XMLMember(11); // Kept for compatibility else if(tag=="dhMaxRight" ) return XMLMember(11); // Kept for compatibility else if(tag=="greaterThanPrevious" ) return XMLMember(1); // Kept for compatibility else return XMLMember(XMLMember::Unknown); }
bool DinverDCCore::ParamLayer::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 _bottomMax, _bottomMin, _dhMax, _dhMin, _isDepth, _lastParamCondition, _linkedTo, _nSubLayers, _shape, _topMax, _topMin, QGpCoreTools::endl(), Linear, LinearDecrease, LinearIncrease, PowerLaw, QGpCoreTools::tr(), TRACE, and Uniform.
{ TRACE; Q_UNUSED(tag) Q_UNUSED(attributes) Q_UNUSED(context); switch (memberID) { case 0: if(content=="Uniform" ) _shape=Uniform; else if(content=="Linear" ) _shape=Linear; else if(content=="LinearIncrease" ) _shape=LinearIncrease; else if(content=="LinearDecrease" ) _shape=LinearDecrease; else if(content=="PowerLaw" ) _shape=PowerLaw; else if(content=="LinearIncr" ) _shape=LinearIncrease; // Kept for compatibility else if(content=="LinearDecr" ) _shape=LinearDecrease; // Kept for compatibility else { App::stream() << tr( "Unknown value %1 for shape" ).arg(content.toString()) << endl; return false; } return true; case 1: _lastParamCondition=content.toBool(); return true; case 2: _nSubLayers=content.toInt(); return true; case 3: _topMin=content.toDouble(); return true; case 4: _topMax=content.toDouble(); return true; case 5: _bottomMin=content.toDouble(); return true; case 6: _bottomMax=content.toDouble(); return true; case 7: _linkedTo=content.toString(); return true; case 8: _isDepth=content.toBool(); return true; case 9: _dhMin=content.toDouble(); return true; case 10: _dhMax=content.toDouble(); return true; case 11: return true; default: return false; } }
virtual const QString& DinverDCCore::ParamLayer::xml_tagName | ( | ) | const [inline, virtual] |
Implements QGpCoreTools::XMLClass.
{return xmlParamLayerTag;}
void DinverDCCore::ParamLayer::xml_writeProperties | ( | XML_WRITEPROPERTIES_ARGS | ) | const [protected, virtual] |
Reimplemented from QGpCoreTools::XMLClass.
References _bottomMax, _bottomMin, _dhMax, _dhMin, _isDepth, _lastParamCondition, _linkedTo, _nSubLayers, _shape, _topMax, _topMin, Linear, LinearDecrease, LinearIncrease, PowerLaw, TRACE, Uniform, and QGpCoreTools::XMLClass::writeProperty().
{ TRACE; Q_UNUSED(context); switch (_shape) { case Linear: writeProperty(s, "shape", "Linear" ); break; case LinearIncrease: writeProperty(s, "shape", "LinearIncrease" ); break; case LinearDecrease: writeProperty(s, "shape", "LinearDecrease" ); break; case PowerLaw: writeProperty(s, "shape", "PowerLaw" ); break; case Uniform: writeProperty(s, "shape", "Uniform" ); break; } writeProperty(s, "lastParamCondition", _lastParamCondition); writeProperty(s, "nSubayers", _nSubLayers); writeProperty(s, "topMin", _topMin); writeProperty(s, "topMax", _topMax); if(_shape!=Uniform) { writeProperty(s, "bottomMin", _bottomMin); writeProperty(s, "bottomMax", _bottomMax); } writeProperty(s, "linkedTo", _linkedTo); writeProperty(s, "isDepth", _isDepth); writeProperty(s, "dhMin", _dhMin); writeProperty(s, "dhMax", _dhMax); }
double DinverDCCore::ParamLayer::_bottomMax [protected] |
Referenced by ParamLayer(), setFinalProfileValuesCondition(), valueToParam(), xml_setProperty(), and xml_writeProperties().
double DinverDCCore::ParamLayer::_bottomMin [protected] |
Referenced by ParamLayer(), setFinalProfileValuesCondition(), valueToParam(), xml_setProperty(), and xml_writeProperties().
Parameter * DinverDCCore::ParamLayer::_bottomP [protected] |
Referenced by collectValueParameters(), ParamLayer(), setFinalProfileValuesParam(), and valueToParam().
double DinverDCCore::ParamLayer::_dhMax [protected] |
Referenced by depthToParam(), fixedThickness(), ParamLayer(), xml_setProperty(), and xml_writeProperties().
double DinverDCCore::ParamLayer::_dhMin [protected] |
Referenced by depthToParam(), fixedThickness(), ParamLayer(), xml_setProperty(), and xml_writeProperties().
Parameter * DinverDCCore::ParamLayer::_dhP [protected] |
double DinverDCCore::ParamLayer::_finalBottomDepth [protected] |
double DinverDCCore::ParamLayer::_finalTopDepth [protected] |
int DinverDCCore::ParamLayer::_index [protected] |
Referenced by fixedBottomDepth(), fixedThickness(), name(), and ParamLayer().
bool DinverDCCore::ParamLayer::_isDepth [protected] |
Referenced by depthToParam(), fixedThickness(), ParamLayer(), setFinalDepths(), setLinkedDepth(), xml_setProperty(), and xml_writeProperties().
bool DinverDCCore::ParamLayer::_lastParamCondition [protected] |
Referenced by ParamLayer(), xml_setProperty(), and xml_writeProperties().
QString DinverDCCore::ParamLayer::_linkedTo [protected] |
Referenced by ParamLayer(), setLinkedTo(), xml_setProperty(), and xml_writeProperties().
int DinverDCCore::ParamLayer::_nSubLayers [protected] |
ParamProfile* DinverDCCore::ParamLayer::_profile [protected] |
Referenced by fixedThickness(), name(), ParamLayer(), and unit().
ParamLayer* DinverDCCore::ParamLayer::_ptrLink [protected] |
Shape DinverDCCore::ParamLayer::_shape [protected] |
int DinverDCCore::ParamLayer::_topDepthIndex [protected] |
double DinverDCCore::ParamLayer::_topMax [protected] |
Referenced by ParamLayer(), setFinalProfileValuesCondition(), valueToParam(), xml_setProperty(), and xml_writeProperties().
double DinverDCCore::ParamLayer::_topMin [protected] |
Referenced by ParamLayer(), setFinalProfileValuesCondition(), valueToParam(), xml_setProperty(), and xml_writeProperties().
Parameter* DinverDCCore::ParamLayer::_topP [protected] |
Referenced by collectValueParameters(), ParamLayer(), setFinalProfileValuesParam(), and valueToParam().
const QString DinverDCCore::ParamLayer::xmlParamLayerTag = "ParamLayer" [static] |