mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#882 Enable export LAS command for Tracks, Plots and Well Logs Folder
This commit is contained in:
parent
59afd14339
commit
86dcc29bce
@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT(RicExportToLasFileFeature, "RicExportToLasFileFeature");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportToLasFileFeature::isCommandEnabled()
|
||||
{
|
||||
return selectedWellLogPlotCurves().size() > 0;
|
||||
return selectedWellLogCurves().size() > 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -47,7 +47,7 @@ bool RicExportToLasFileFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellLogCurve*> curves = selectedWellLogPlotCurves();
|
||||
std::vector<RimWellLogCurve*> curves = selectedWellLogCurves();
|
||||
if (curves.size() == 0) return;
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
@ -82,17 +82,42 @@ void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportToLasFileFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Export To LAS File...");
|
||||
actionToSetup->setText("Export To LAS Files...");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellLogCurve*> RicExportToLasFileFeature::selectedWellLogPlotCurves() const
|
||||
std::vector<RimWellLogCurve*> RicExportToLasFileFeature::selectedWellLogCurves() const
|
||||
{
|
||||
std::vector<RimWellLogCurve*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
std::set<RimWellLogCurve*> curveSet;
|
||||
|
||||
return selection;
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> selectedItems;
|
||||
caf::SelectionManager::instance()->selectedItems(selectedItems);
|
||||
|
||||
for (auto selectedItem : selectedItems)
|
||||
{
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(selectedItem);
|
||||
if (objHandle)
|
||||
{
|
||||
std::vector<RimWellLogCurve*> childCurves;
|
||||
objHandle->descendantsIncludingThisOfType(childCurves);
|
||||
|
||||
for (auto curve : childCurves)
|
||||
{
|
||||
curveSet.insert(curve);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<RimWellLogCurve*> allCurves;
|
||||
for (auto curve : curveSet)
|
||||
{
|
||||
allCurves.push_back(curve);
|
||||
}
|
||||
|
||||
return allCurves;
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,6 @@ protected:
|
||||
virtual void setupActionLook( QAction* actionToSetup );
|
||||
|
||||
private:
|
||||
std::vector<RimWellLogCurve*> selectedWellLogPlotCurves() const;
|
||||
std::vector<RimWellLogCurve*> selectedWellLogCurves() const;
|
||||
};
|
||||
|
||||
|
@ -351,7 +351,10 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
commandIds << "RicExecuteScriptForCasesFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimWellLogCurve*>(uiItem))
|
||||
else if (dynamic_cast<RimWellLogCurve*>(uiItem) ||
|
||||
dynamic_cast<RimWellLogTrack*>(uiItem) ||
|
||||
dynamic_cast<RimWellLogPlot*>(uiItem) ||
|
||||
dynamic_cast<RimWellLogPlotCollection*>(uiItem))
|
||||
{
|
||||
commandIds << "RicExportToLasFileFeature";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user