Make draw plane selection for curves be unrelated to 3d Track (somewhat related to #2825).

* Makes more sense user wise and makes for better code.
* Helps refactor code to relate grids to curves so the curves can have access to the grid
   it is being drawn on.
* This will help fix #2825 by being able to project curve points onto the exact triangle geometry.
This commit is contained in:
Gaute Lindkvist
2018-04-30 09:22:59 +02:00
parent 7307b97466
commit 1f44ea1ea3
14 changed files with 153 additions and 216 deletions

View File

@@ -44,8 +44,10 @@ namespace caf
void AppEnum< Rim3dWellLogCurve::DrawPlane >::setUp()
{
addItem(Rim3dWellLogCurve::VERTICAL_ABOVE, "VERTICAL_ABOVE", "Above");
addItem(Rim3dWellLogCurve::VERTICAL_CENTER, "VERTICAL_CENTER", "Centered - Vertical");
addItem(Rim3dWellLogCurve::VERTICAL_BELOW, "VERTICAL_BELOW", "Below");
addItem(Rim3dWellLogCurve::HORIZONTAL_LEFT, "HORIZONTAL_LEFT", "Left");
addItem(Rim3dWellLogCurve::HORIZONTAL_CENTER, "HORIZONTAL_CENTER", "Centered - Horizontal");
addItem(Rim3dWellLogCurve::HORIZONTAL_RIGHT, "HORIZONTAL_RIGHT", "Right");
setDefault(Rim3dWellLogCurve::VERTICAL_ABOVE);
}
@@ -96,6 +98,28 @@ Rim3dWellLogCurve::DrawPlane Rim3dWellLogCurve::drawPlane() const
return m_drawPlane();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double Rim3dWellLogCurve::drawPlaneAngle() const
{
switch (drawPlane())
{
case HORIZONTAL_LEFT:
case HORIZONTAL_CENTER:
return cvf::PI_D / 2.0;
case HORIZONTAL_RIGHT:
return -cvf::PI_D / 2.0;
case VERTICAL_ABOVE:
case VERTICAL_CENTER:
return 0.0;
case VERTICAL_BELOW:
return cvf::PI_D;
default:
return 0;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -173,35 +197,6 @@ void Rim3dWellLogCurve::configurationUiOrdering(caf::PdmUiOrdering& uiOrdering)
configurationGroup->add(&m_maxCurveValue);
}
QList<caf::PdmOptionItemInfo> Rim3dWellLogCurve::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
if (fieldNeedingOptions == &m_drawPlane)
{
Rim3dWellLogCurveCollection* collection;
this->firstAncestorOrThisOfTypeAsserted(collection);
if (collection->planePositionVertical() == Rim3dWellLogCurveCollection::ALONG_WELLPATH)
{
options.push_back(caf::PdmOptionItemInfo(DrawPlaneEnum::uiText(Rim3dWellLogCurve::VERTICAL_ABOVE), Rim3dWellLogCurve::VERTICAL_ABOVE));
options.push_back(caf::PdmOptionItemInfo(DrawPlaneEnum::uiText(Rim3dWellLogCurve::VERTICAL_BELOW), Rim3dWellLogCurve::VERTICAL_BELOW));
}
else
{
options.push_back(caf::PdmOptionItemInfo(QString("Vertical"), Rim3dWellLogCurve::VERTICAL_ABOVE));
}
if (collection->planePositionHorizontal() == Rim3dWellLogCurveCollection::ALONG_WELLPATH)
{
options.push_back(caf::PdmOptionItemInfo(DrawPlaneEnum::uiText(Rim3dWellLogCurve::HORIZONTAL_LEFT), Rim3dWellLogCurve::HORIZONTAL_LEFT));
options.push_back(caf::PdmOptionItemInfo(DrawPlaneEnum::uiText(Rim3dWellLogCurve::HORIZONTAL_RIGHT), Rim3dWellLogCurve::HORIZONTAL_RIGHT));
}
else
{
options.push_back(caf::PdmOptionItemInfo(QString("Horizontal"), Rim3dWellLogCurve::HORIZONTAL_LEFT));
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------