예제 #1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicDeleteWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
{
    if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;

    std::vector<RimWellLogTrack*> selection;
    caf::SelectionManager::instance()->objectsByType(&selection);

    for (size_t i = 0; i < selection.size(); i++)
    {
        RimWellLogTrack* track = selection[i];

        RimWellLogPlot* wellLogPlot = nullptr;
        track->firstAncestorOrThisOfType(wellLogPlot);
        if (wellLogPlot && wellLogPlot->trackCount() > 1)
        {
            wellLogPlot->removeTrack(track);
            caf::SelectionManager::instance()->removeObjectFromAllSelections(track);
            delete track;

            wellLogPlot->calculateAvailableDepthRange();
            wellLogPlot->updateDepthZoom();
            wellLogPlot->uiCapability()->updateConnectedEditors();
        }
    }
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
{
    RimWellLogPlot* wellLogPlot = selectedWellLogPlot();
    if (wellLogPlot)
    {
         RimWellLogTrack* plotTrack = new RimWellLogTrack;
         wellLogPlot->addTrack(plotTrack);
         plotTrack->setDescription(QString("Track %1").arg(wellLogPlot->trackCount()));

         wellLogPlot->updateConnectedEditors();
         RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL);
    }
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
{
    std::vector<RimWellLogTrack*> selection;
    caf::SelectionManager::instance()->objectsByType(&selection);

    if (selection.size() > 0)
    {
        RimWellLogPlot* wellLogPlot = NULL;
        selection[0]->firstAncestorOrThisOfType(wellLogPlot);
        if (wellLogPlot->trackCount() > 1)
        {
            return true;
        }
    }

    return false;
}
예제 #4
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
{
    if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;

    std::vector<RimWellLogTrack*> selection;
    caf::SelectionManager::instance()->objectsByType(&selection);

    if (selection.size() > 0)
    {
        RimWellLogPlot* wellLogPlot = nullptr;
        selection[0]->firstAncestorOrThisOfType(wellLogPlot);
        if (wellLogPlot && wellLogPlot->trackCount() > 1)
        {
            return true;
        }
    }

    return false;
}