mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#1510 Remove invalid usage of namespace caf for features
Also add override keyword
This commit is contained in:
parent
d67d5ec330
commit
d8dc62c5a7
@ -38,8 +38,6 @@
|
|||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicCopyReferencesToClipboardFeature, "RicCopyReferencesToClipboardFeature");
|
CAF_CMD_SOURCE_INIT(RicCopyReferencesToClipboardFeature, "RicCopyReferencesToClipboardFeature");
|
||||||
|
|
||||||
@ -63,14 +61,14 @@ void RicCopyReferencesToClipboardFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
std::vector<QString> referenceList;
|
std::vector<QString> referenceList;
|
||||||
|
|
||||||
std::vector<PdmObject*> selectedFormationNamesCollObjs;
|
std::vector<caf::PdmObject*> selectedFormationNamesCollObjs;
|
||||||
caf::SelectionManager::instance()->objectsByType(&selectedFormationNamesCollObjs);
|
caf::SelectionManager::instance()->objectsByType(&selectedFormationNamesCollObjs);
|
||||||
|
|
||||||
for (PdmObject* pdmObject : selectedFormationNamesCollObjs)
|
for (caf::PdmObject* pdmObject : selectedFormationNamesCollObjs)
|
||||||
{
|
{
|
||||||
if (RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(pdmObject))
|
if (RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(pdmObject))
|
||||||
{
|
{
|
||||||
QString itemRef = PdmReferenceHelper::referenceFromRootToObject(SelectionManager::instance()->pdmRootObject(), pdmObject);
|
QString itemRef = caf::PdmReferenceHelper::referenceFromRootToObject(caf::SelectionManager::instance()->pdmRootObject(), pdmObject);
|
||||||
|
|
||||||
referenceList.push_back(itemRef);
|
referenceList.push_back(itemRef);
|
||||||
}
|
}
|
||||||
@ -96,16 +94,15 @@ void RicCopyReferencesToClipboardFeature::setupActionLook(QAction* actionToSetup
|
|||||||
actionToSetup->setShortcuts(QKeySequence::Copy);
|
actionToSetup->setShortcuts(QKeySequence::Copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicCopyReferencesToClipboardFeature::isAnyCopyableObjectSelected()
|
bool RicCopyReferencesToClipboardFeature::isAnyCopyableObjectSelected()
|
||||||
{
|
{
|
||||||
std::vector<PdmObject*> selectedFormationNamesCollObjs;
|
std::vector<caf::PdmObject*> selectedFormationNamesCollObjs;
|
||||||
caf::SelectionManager::instance()->objectsByType(&selectedFormationNamesCollObjs);
|
caf::SelectionManager::instance()->objectsByType(&selectedFormationNamesCollObjs);
|
||||||
|
|
||||||
for (PdmObject* pdmObject : selectedFormationNamesCollObjs)
|
for (caf::PdmObject* pdmObject : selectedFormationNamesCollObjs)
|
||||||
{
|
{
|
||||||
if (RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(pdmObject))
|
if (RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(pdmObject))
|
||||||
{
|
{
|
||||||
@ -116,12 +113,10 @@ bool RicCopyReferencesToClipboardFeature::isAnyCopyableObjectSelected()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(PdmObject* pdmObject)
|
bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(caf::PdmObject* pdmObject)
|
||||||
{
|
{
|
||||||
RimWellAllocationPlot* wellAllocPlot = nullptr;
|
RimWellAllocationPlot* wellAllocPlot = nullptr;
|
||||||
pdmObject->firstAncestorOrThisOfType(wellAllocPlot);
|
pdmObject->firstAncestorOrThisOfType(wellAllocPlot);
|
||||||
@ -161,5 +156,3 @@ bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(PdmObject* pdm
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -24,27 +24,23 @@
|
|||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
|
class PdmObject;
|
||||||
class PdmObject;
|
}
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicCopyReferencesToClipboardFeature : public CmdFeature
|
class RicCopyReferencesToClipboardFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool isAnyCopyableObjectSelected();
|
static bool isAnyCopyableObjectSelected();
|
||||||
static bool isCopyOfObjectSupported(PdmObject* pdmObject);
|
static bool isCopyOfObjectSupported(caf::PdmObject* pdmObject);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -42,8 +42,6 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicPasteEclipseCasesFeature, "RicPasteEclipseCasesFeature");
|
CAF_CMD_SOURCE_INIT(RicPasteEclipseCasesFeature, "RicPasteEclipseCasesFeature");
|
||||||
|
|
||||||
@ -53,7 +51,7 @@ CAF_CMD_SOURCE_INIT(RicPasteEclipseCasesFeature, "RicPasteEclipseCasesFeature");
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicPasteEclipseCasesFeature::isCommandEnabled()
|
bool RicPasteEclipseCasesFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
PdmObjectGroup objectGroup;
|
caf::PdmObjectGroup objectGroup;
|
||||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
||||||
|
|
||||||
std::vector<caf::PdmPointer<RimEclipseResultCase> > typedObjects;
|
std::vector<caf::PdmPointer<RimEclipseResultCase> > typedObjects;
|
||||||
@ -64,7 +62,7 @@ bool RicPasteEclipseCasesFeature::isCommandEnabled()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PdmObjectHandle* destinationObject = dynamic_cast<PdmObjectHandle*>(SelectionManager::instance()->selectedItem());
|
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||||
|
|
||||||
RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject);
|
RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject);
|
||||||
if (gridCaseGroup) return true;
|
if (gridCaseGroup) return true;
|
||||||
@ -77,12 +75,12 @@ bool RicPasteEclipseCasesFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicPasteEclipseCasesFeature::onActionTriggered(bool isChecked)
|
void RicPasteEclipseCasesFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
PdmObjectHandle* destinationObject = dynamic_cast<PdmObjectHandle*>(SelectionManager::instance()->selectedItem());
|
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||||
|
|
||||||
RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject);
|
RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject);
|
||||||
if (!gridCaseGroup) return;
|
if (!gridCaseGroup) return;
|
||||||
|
|
||||||
PdmObjectGroup objectGroup;
|
caf::PdmObjectGroup objectGroup;
|
||||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
||||||
|
|
||||||
if (objectGroup.objects.size() == 0) return;
|
if (objectGroup.objects.size() == 0) return;
|
||||||
@ -105,7 +103,7 @@ void RicPasteEclipseCasesFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup)
|
void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup)
|
||||||
{
|
{
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
CVF_ASSERT(proj);
|
CVF_ASSERT(proj);
|
||||||
@ -202,5 +200,3 @@ void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(PdmObjectGroup& object
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -28,6 +28,7 @@ class RimIdenticalGridCaseGroup;
|
|||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
class PdmObjectGroup;
|
class PdmObjectGroup;
|
||||||
|
}
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -37,15 +38,11 @@ class RicPasteEclipseCasesFeature : public caf::CmdFeature
|
|||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void addCasesToGridCaseGroup(PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup);
|
static void addCasesToGridCaseGroup(caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered(bool isChecked);
|
virtual void onActionTriggered(bool isChecked) override;
|
||||||
virtual void setupActionLook(QAction* actionToSetup);
|
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -35,8 +35,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicPasteEclipseViewsFeature, "RicPasteEclipseViewsFeature");
|
CAF_CMD_SOURCE_INIT(RicPasteEclipseViewsFeature, "RicPasteEclipseViewsFeature");
|
||||||
|
|
||||||
@ -45,7 +43,7 @@ CAF_CMD_SOURCE_INIT(RicPasteEclipseViewsFeature, "RicPasteEclipseViewsFeature");
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicPasteEclipseViewsFeature::isCommandEnabled()
|
bool RicPasteEclipseViewsFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
PdmObjectGroup objectGroup;
|
caf::PdmObjectGroup objectGroup;
|
||||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
||||||
|
|
||||||
std::vector<caf::PdmPointer<RimEclipseView> > typedObjects;
|
std::vector<caf::PdmPointer<RimEclipseView> > typedObjects;
|
||||||
@ -56,7 +54,7 @@ bool RicPasteEclipseViewsFeature::isCommandEnabled()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PdmObjectHandle* destinationObject = dynamic_cast<PdmObjectHandle*>(SelectionManager::instance()->selectedItem());
|
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||||
|
|
||||||
RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject);
|
RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject);
|
||||||
if (gridCaseGroup) return false;
|
if (gridCaseGroup) return false;
|
||||||
@ -72,12 +70,12 @@ bool RicPasteEclipseViewsFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked)
|
void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
PdmObjectHandle* destinationObject = dynamic_cast<PdmObjectHandle*>(SelectionManager::instance()->selectedItem());
|
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||||
|
|
||||||
RimEclipseCase* eclipseCase = RicPasteFeatureImpl::findEclipseCase(destinationObject);
|
RimEclipseCase* eclipseCase = RicPasteFeatureImpl::findEclipseCase(destinationObject);
|
||||||
assert(eclipseCase);
|
assert(eclipseCase);
|
||||||
|
|
||||||
PdmObjectGroup objectGroup;
|
caf::PdmObjectGroup objectGroup;
|
||||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
||||||
|
|
||||||
if (objectGroup.objects.size() == 0) return;
|
if (objectGroup.objects.size() == 0) return;
|
||||||
@ -90,7 +88,7 @@ void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked)
|
|||||||
// Add cases to case group
|
// Add cases to case group
|
||||||
for (size_t i = 0; i < eclipseViews.size(); i++)
|
for (size_t i = 0; i < eclipseViews.size(); i++)
|
||||||
{
|
{
|
||||||
RimEclipseView* rimReservoirView = dynamic_cast<RimEclipseView*>(eclipseViews[i]->xmlCapability()->copyByXmlSerialization(PdmDefaultObjectFactory::instance()));
|
RimEclipseView* rimReservoirView = dynamic_cast<RimEclipseView*>(eclipseViews[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
|
||||||
CVF_ASSERT(rimReservoirView);
|
CVF_ASSERT(rimReservoirView);
|
||||||
|
|
||||||
QString nameOfCopy = QString("Copy of ") + rimReservoirView->name;
|
QString nameOfCopy = QString("Copy of ") + rimReservoirView->name;
|
||||||
@ -124,6 +122,3 @@ void RicPasteEclipseViewsFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
|
|
||||||
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
|
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -35,11 +33,8 @@ CAF_CMD_HEADER_INIT;
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered(bool isChecked);
|
virtual void onActionTriggered(bool isChecked) override;
|
||||||
virtual void setupActionLook(QAction* actionToSetup);
|
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicPasteGeoMechViewsFeature, "RicPasteGeoMechViewsFeature");
|
CAF_CMD_SOURCE_INIT(RicPasteGeoMechViewsFeature, "RicPasteGeoMechViewsFeature");
|
||||||
|
|
||||||
@ -42,7 +40,7 @@ CAF_CMD_SOURCE_INIT(RicPasteGeoMechViewsFeature, "RicPasteGeoMechViewsFeature");
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicPasteGeoMechViewsFeature::isCommandEnabled()
|
bool RicPasteGeoMechViewsFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
PdmObjectGroup objectGroup;
|
caf::PdmObjectGroup objectGroup;
|
||||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
||||||
|
|
||||||
std::vector<caf::PdmPointer<RimGeoMechView> > typedObjects;
|
std::vector<caf::PdmPointer<RimGeoMechView> > typedObjects;
|
||||||
@ -53,7 +51,7 @@ bool RicPasteGeoMechViewsFeature::isCommandEnabled()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PdmObjectHandle* destinationObject = dynamic_cast<PdmObjectHandle*>(SelectionManager::instance()->selectedItem());
|
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||||
|
|
||||||
RimGeoMechCase* geoMechCase = RicPasteFeatureImpl::findGeoMechCase(destinationObject);
|
RimGeoMechCase* geoMechCase = RicPasteFeatureImpl::findGeoMechCase(destinationObject);
|
||||||
if (geoMechCase) return true;
|
if (geoMechCase) return true;
|
||||||
@ -66,12 +64,12 @@ bool RicPasteGeoMechViewsFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicPasteGeoMechViewsFeature::onActionTriggered(bool isChecked)
|
void RicPasteGeoMechViewsFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
PdmObjectHandle* destinationObject = dynamic_cast<PdmObjectHandle*>(SelectionManager::instance()->selectedItem());
|
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
|
||||||
|
|
||||||
RimGeoMechCase* geomCase = RicPasteFeatureImpl::findGeoMechCase(destinationObject);
|
RimGeoMechCase* geomCase = RicPasteFeatureImpl::findGeoMechCase(destinationObject);
|
||||||
assert(geomCase);
|
assert(geomCase);
|
||||||
|
|
||||||
PdmObjectGroup objectGroup;
|
caf::PdmObjectGroup objectGroup;
|
||||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
|
||||||
|
|
||||||
if (objectGroup.objects.size() == 0) return;
|
if (objectGroup.objects.size() == 0) return;
|
||||||
@ -84,7 +82,7 @@ void RicPasteGeoMechViewsFeature::onActionTriggered(bool isChecked)
|
|||||||
// Add cases to case group
|
// Add cases to case group
|
||||||
for (size_t i = 0; i < geomViews.size(); i++)
|
for (size_t i = 0; i < geomViews.size(); i++)
|
||||||
{
|
{
|
||||||
RimGeoMechView* rimReservoirView = dynamic_cast<RimGeoMechView*>(geomViews[i]->xmlCapability()->copyByXmlSerialization(PdmDefaultObjectFactory::instance()));
|
RimGeoMechView* rimReservoirView = dynamic_cast<RimGeoMechView*>(geomViews[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
|
||||||
QString nameOfCopy = QString("Copy of ") + rimReservoirView->name;
|
QString nameOfCopy = QString("Copy of ") + rimReservoirView->name;
|
||||||
rimReservoirView->name = nameOfCopy;
|
rimReservoirView->name = nameOfCopy;
|
||||||
geomCase->geoMechViews().push_back(rimReservoirView);
|
geomCase->geoMechViews().push_back(rimReservoirView);
|
||||||
@ -117,6 +115,3 @@ void RicPasteGeoMechViewsFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
|
|
||||||
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
|
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -22,10 +22,6 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@ -35,11 +31,7 @@ CAF_CMD_HEADER_INIT;
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered(bool isChecked);
|
virtual void onActionTriggered(bool isChecked) override;
|
||||||
virtual void setupActionLook(QAction* actionToSetup);
|
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -30,9 +30,6 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalFeature, "RicNewPerforationIntervalFeature");
|
CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalFeature, "RicNewPerforationIntervalFeature");
|
||||||
|
|
||||||
@ -92,5 +89,3 @@ RimWellPath * RicNewPerforationIntervalFeature::selectedWellPath()
|
|||||||
|
|
||||||
return wellPath;
|
return wellPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -23,26 +23,19 @@
|
|||||||
|
|
||||||
class RimWellPath;
|
class RimWellPath;
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicNewPerforationIntervalFeature : public CmdFeature
|
class RicNewPerforationIntervalFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RimWellPath* selectedWellPath();
|
RimWellPath* selectedWellPath();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,8 +21,10 @@
|
|||||||
#include "RicDeleteItemExec.h"
|
#include "RicDeleteItemExec.h"
|
||||||
#include "RicDeleteItemExecData.h"
|
#include "RicDeleteItemExecData.h"
|
||||||
|
|
||||||
|
#include "RimCase.h"
|
||||||
#include "RimCellRangeFilterCollection.h"
|
#include "RimCellRangeFilterCollection.h"
|
||||||
#include "RimEclipsePropertyFilterCollection.h"
|
#include "RimEclipsePropertyFilterCollection.h"
|
||||||
|
#include "RimFormationNamesCollection.h"
|
||||||
#include "RimGeoMechPropertyFilterCollection.h"
|
#include "RimGeoMechPropertyFilterCollection.h"
|
||||||
#include "RimIntersectionCollection.h"
|
#include "RimIntersectionCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
@ -39,13 +41,8 @@
|
|||||||
#include "cafPdmReferenceHelper.h"
|
#include "cafPdmReferenceHelper.h"
|
||||||
#include "cafPdmUiFieldHandle.h"
|
#include "cafPdmUiFieldHandle.h"
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
#include "RimFormationNamesCollection.h"
|
|
||||||
#include "RimCase.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -59,15 +56,15 @@ QString RicDeleteItemExec::name()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicDeleteItemExec::redo()
|
void RicDeleteItemExec::redo()
|
||||||
{
|
{
|
||||||
PdmFieldHandle* field = PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField);
|
caf::PdmFieldHandle* field = caf::PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField);
|
||||||
|
|
||||||
PdmChildArrayFieldHandle* listField = dynamic_cast<PdmChildArrayFieldHandle*>(field);
|
caf::PdmChildArrayFieldHandle* listField = dynamic_cast<caf::PdmChildArrayFieldHandle*>(field);
|
||||||
if (listField)
|
if (listField)
|
||||||
{
|
{
|
||||||
std::vector<PdmObjectHandle*> children;
|
std::vector<caf::PdmObjectHandle*> children;
|
||||||
listField->childObjects(&children);
|
listField->childObjects(&children);
|
||||||
|
|
||||||
PdmObjectHandle* obj = children[m_commandData->m_indexToObject];
|
caf::PdmObjectHandle* obj = children[m_commandData->m_indexToObject];
|
||||||
caf::SelectionManager::instance()->removeObjectFromAllSelections(obj);
|
caf::SelectionManager::instance()->removeObjectFromAllSelections(obj);
|
||||||
|
|
||||||
std::vector<caf::PdmObjectHandle*> referringObjects;
|
std::vector<caf::PdmObjectHandle*> referringObjects;
|
||||||
@ -204,12 +201,12 @@ void RicDeleteItemExec::redo()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicDeleteItemExec::undo()
|
void RicDeleteItemExec::undo()
|
||||||
{
|
{
|
||||||
PdmFieldHandle* field = PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField);
|
caf::PdmFieldHandle* field = caf::PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField);
|
||||||
|
|
||||||
PdmChildArrayFieldHandle* listField = dynamic_cast<PdmChildArrayFieldHandle*>(field);
|
caf::PdmChildArrayFieldHandle* listField = dynamic_cast<caf::PdmChildArrayFieldHandle*>(field);
|
||||||
if (listField)
|
if (listField)
|
||||||
{
|
{
|
||||||
PdmObjectHandle* obj = PdmXmlObjectHandle::readUnknownObjectFromXmlString(m_commandData->m_deletedObjectAsXml(), PdmDefaultObjectFactory::instance());
|
caf::PdmObjectHandle* obj = caf::PdmXmlObjectHandle::readUnknownObjectFromXmlString(m_commandData->m_deletedObjectAsXml(), caf::PdmDefaultObjectFactory::instance());
|
||||||
|
|
||||||
listField->insertAt(m_commandData->m_indexToObject, obj);
|
listField->insertAt(m_commandData->m_indexToObject, obj);
|
||||||
|
|
||||||
@ -225,7 +222,7 @@ void RicDeleteItemExec::undo()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicDeleteItemExec::RicDeleteItemExec(NotificationCenter* notificationCenter)
|
RicDeleteItemExec::RicDeleteItemExec(caf::NotificationCenter* notificationCenter)
|
||||||
: CmdExecuteCommand(notificationCenter)
|
: CmdExecuteCommand(notificationCenter)
|
||||||
{
|
{
|
||||||
m_commandData = new RicDeleteItemExecData;
|
m_commandData = new RicDeleteItemExecData;
|
||||||
@ -238,5 +235,3 @@ RicDeleteItemExecData* RicDeleteItemExec::commandData()
|
|||||||
{
|
{
|
||||||
return m_commandData;
|
return m_commandData;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -22,18 +22,15 @@
|
|||||||
|
|
||||||
#include "cafCmdExecuteCommand.h"
|
#include "cafCmdExecuteCommand.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
class RicDeleteItemExecData;
|
class RicDeleteItemExecData;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicDeleteItemExec : public CmdExecuteCommand
|
class RicDeleteItemExec : public caf::CmdExecuteCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RicDeleteItemExec(NotificationCenter* notificationCenter);
|
explicit RicDeleteItemExec(caf::NotificationCenter* notificationCenter);
|
||||||
|
|
||||||
RicDeleteItemExecData* commandData();
|
RicDeleteItemExecData* commandData();
|
||||||
|
|
||||||
@ -44,7 +41,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
RicDeleteItemExecData* m_commandData;
|
RicDeleteItemExecData* m_commandData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,9 +21,4 @@
|
|||||||
#include "RicDeleteItemExecData.h"
|
#include "RicDeleteItemExecData.h"
|
||||||
|
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RicDeleteItemExecData, "RicDeleteItemExecData");
|
CAF_PDM_SOURCE_INIT(RicDeleteItemExecData, "RicDeleteItemExecData");
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -23,14 +23,10 @@
|
|||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicDeleteItemExecData : public PdmObject
|
class RicDeleteItemExecData : public caf::PdmObject
|
||||||
{
|
{
|
||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
@ -44,13 +40,9 @@ public:
|
|||||||
CAF_PDM_InitField(&m_deletedObjectAsXml, "deletedObjectAsXml", QString(), "deletedObjectAsXml", "", "deletedObjectAsXml tooltip", "deletedObjectAsXml whatsthis");
|
CAF_PDM_InitField(&m_deletedObjectAsXml, "deletedObjectAsXml", QString(), "deletedObjectAsXml", "", "deletedObjectAsXml tooltip", "deletedObjectAsXml whatsthis");
|
||||||
}
|
}
|
||||||
|
|
||||||
caf::PdmPointer<PdmObjectHandle> m_rootObject;
|
caf::PdmPointer<caf::PdmObjectHandle> m_rootObject;
|
||||||
|
|
||||||
caf::PdmField<QString> m_pathToField;
|
caf::PdmField<QString> m_pathToField;
|
||||||
caf::PdmField<int> m_indexToObject;
|
caf::PdmField<int> m_indexToObject;
|
||||||
caf::PdmField<QString> m_deletedObjectAsXml;
|
caf::PdmField<QString> m_deletedObjectAsXml;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -55,11 +55,9 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
namespace caf
|
CAF_CMD_SOURCE_INIT(RicDeleteItemFeature, "RicDeleteItemFeature");
|
||||||
{
|
|
||||||
CAF_CMD_SOURCE_INIT(RicDeleteItemFeature, "RicDeleteItemFeature");
|
|
||||||
|
|
||||||
bool isDeletable(PdmUiItem * uiItem)
|
bool isDeletable(caf::PdmUiItem* uiItem)
|
||||||
{
|
{
|
||||||
// Enable delete of well allocation plots
|
// Enable delete of well allocation plots
|
||||||
if (dynamic_cast<RimWellAllocationPlot*>(uiItem)) return true;
|
if (dynamic_cast<RimWellAllocationPlot*>(uiItem)) return true;
|
||||||
@ -107,12 +105,12 @@ bool isDeletable(PdmUiItem * uiItem)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicDeleteItemFeature::isCommandEnabled()
|
bool RicDeleteItemFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
std::vector<PdmUiItem*> items;
|
std::vector<caf::PdmUiItem*> items;
|
||||||
caf::SelectionManager::instance()->selectedItems(items);
|
caf::SelectionManager::instance()->selectedItems(items);
|
||||||
|
|
||||||
if (items.empty() ) return false;
|
if (items.empty() ) return false;
|
||||||
|
|
||||||
for (PdmUiItem* item : items)
|
for (caf::PdmUiItem* item : items)
|
||||||
{
|
{
|
||||||
if (!isDeletable(item)) return false;
|
if (!isDeletable(item)) return false;
|
||||||
|
|
||||||
@ -131,11 +129,11 @@ bool RicDeleteItemFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicDeleteItemFeature::onActionTriggered(bool isChecked)
|
void RicDeleteItemFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
std::vector<PdmUiItem*> items;
|
std::vector<caf::PdmUiItem*> items;
|
||||||
SelectionManager::instance()->selectedItems(items);
|
caf::SelectionManager::instance()->selectedItems(items);
|
||||||
assert(items.size() > 0);
|
assert(items.size() > 0);
|
||||||
|
|
||||||
for (PdmUiItem* item: items)
|
for (caf::PdmUiItem* item: items)
|
||||||
{
|
{
|
||||||
if (!isDeletable(item)) continue;
|
if (!isDeletable(item)) continue;
|
||||||
|
|
||||||
@ -147,7 +145,7 @@ void RicDeleteItemFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
int indexAfter = -1;
|
int indexAfter = -1;
|
||||||
|
|
||||||
std::vector<PdmObjectHandle*> childObjects;
|
std::vector<caf::PdmObjectHandle*> childObjects;
|
||||||
childArrayFieldHandle->childObjects(&childObjects);
|
childArrayFieldHandle->childObjects(&childObjects);
|
||||||
|
|
||||||
for ( size_t i = 0; i < childObjects.size(); i++ )
|
for ( size_t i = 0; i < childObjects.size(); i++ )
|
||||||
@ -161,15 +159,15 @@ void RicDeleteItemFeature::onActionTriggered(bool isChecked)
|
|||||||
// Did not find currently selected pdm object in the current list field
|
// Did not find currently selected pdm object in the current list field
|
||||||
assert(indexAfter != -1);
|
assert(indexAfter != -1);
|
||||||
|
|
||||||
RicDeleteItemExec* executeCmd = new RicDeleteItemExec(SelectionManager::instance()->notificationCenter());
|
RicDeleteItemExec* executeCmd = new RicDeleteItemExec(caf::SelectionManager::instance()->notificationCenter());
|
||||||
|
|
||||||
RicDeleteItemExecData* data = executeCmd->commandData();
|
RicDeleteItemExecData* data = executeCmd->commandData();
|
||||||
data->m_rootObject = PdmReferenceHelper::findRoot(childArrayFieldHandle);
|
data->m_rootObject = caf::PdmReferenceHelper::findRoot(childArrayFieldHandle);
|
||||||
data->m_pathToField = PdmReferenceHelper::referenceFromRootToField(data->m_rootObject, childArrayFieldHandle);
|
data->m_pathToField = caf::PdmReferenceHelper::referenceFromRootToField(data->m_rootObject, childArrayFieldHandle);
|
||||||
data->m_indexToObject = indexAfter;
|
data->m_indexToObject = indexAfter;
|
||||||
|
|
||||||
|
|
||||||
CmdExecCommandManager::instance()->processExecuteCommand(executeCmd);
|
caf::CmdExecCommandManager::instance()->processExecuteCommand(executeCmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,5 +179,3 @@ void RicDeleteItemFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
actionToSetup->setText("Delete");
|
actionToSetup->setText("Delete");
|
||||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,16 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicDeleteItemFeature : public CmdFeature
|
class RicDeleteItemFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -19,14 +19,11 @@
|
|||||||
|
|
||||||
#include "RicToggleItemsFeature.h"
|
#include "RicToggleItemsFeature.h"
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
|
||||||
|
|
||||||
#include "RicToggleItemsFeatureImpl.h"
|
#include "RicToggleItemsFeatureImpl.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
namespace caf
|
#include <QAction>
|
||||||
{
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicToggleItemsFeature, "RicToggleItemsFeature");
|
CAF_CMD_SOURCE_INIT(RicToggleItemsFeature, "RicToggleItemsFeature");
|
||||||
|
|
||||||
@ -56,5 +53,3 @@ void RicToggleItemsFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
else
|
else
|
||||||
actionToSetup->setText("Toggle");
|
actionToSetup->setText("Toggle");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,16 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicToggleItemsFeature : public CmdFeature
|
class RicToggleItemsFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -19,14 +19,11 @@
|
|||||||
|
|
||||||
#include "RicToggleItemsOffFeature.h"
|
#include "RicToggleItemsOffFeature.h"
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
|
||||||
|
|
||||||
#include "RicToggleItemsFeatureImpl.h"
|
#include "RicToggleItemsFeatureImpl.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
namespace caf
|
#include <QAction>
|
||||||
{
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicToggleItemsOffFeature, "RicToggleItemsOffFeature");
|
CAF_CMD_SOURCE_INIT(RicToggleItemsOffFeature, "RicToggleItemsOffFeature");
|
||||||
|
|
||||||
@ -56,5 +53,3 @@ void RicToggleItemsOffFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
else
|
else
|
||||||
actionToSetup->setText("Off");
|
actionToSetup->setText("Off");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,16 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicToggleItemsOffFeature : public CmdFeature
|
class RicToggleItemsOffFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -19,14 +19,11 @@
|
|||||||
|
|
||||||
#include "RicToggleItemsOnFeature.h"
|
#include "RicToggleItemsOnFeature.h"
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
|
||||||
|
|
||||||
#include "RicToggleItemsFeatureImpl.h"
|
#include "RicToggleItemsFeatureImpl.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
namespace caf
|
#include <QAction>
|
||||||
{
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicToggleItemsOnFeature, "RicToggleItemsOnFeature");
|
CAF_CMD_SOURCE_INIT(RicToggleItemsOnFeature, "RicToggleItemsOnFeature");
|
||||||
|
|
||||||
@ -56,5 +53,3 @@ void RicToggleItemsOnFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
else
|
else
|
||||||
actionToSetup->setText("On");
|
actionToSetup->setText("On");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,16 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicToggleItemsOnFeature : public CmdFeature
|
class RicToggleItemsOnFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -43,9 +43,7 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
namespace caf
|
CAF_CMD_SOURCE_INIT(RicAddWellLogToPlotFeature, "RicAddWellLogToPlotFeature");
|
||||||
{
|
|
||||||
CAF_CMD_SOURCE_INIT(RicAddWellLogToPlotFeature, "RicAddWellLogToPlotFeature");
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -135,5 +133,3 @@ std::vector<RimWellLogFileChannel*> RicAddWellLogToPlotFeature::selectedWellLogs
|
|||||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||||
return selection;
|
return selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -28,26 +28,20 @@ class RimWellLogPlotCollection;
|
|||||||
class RimWellLogPlot;
|
class RimWellLogPlot;
|
||||||
class RimWellLogFileChannel;
|
class RimWellLogFileChannel;
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicAddWellLogToPlotFeature : public CmdFeature
|
class RicAddWellLogToPlotFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<RimWellLogFileChannel*> selectedWellLogs();
|
std::vector<RimWellLogFileChannel*> selectedWellLogs();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -26,10 +26,7 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
namespace caf
|
CAF_CMD_SOURCE_INIT(RicWellLogsImportFileFeature, "RicWellLogsImportFileFeature");
|
||||||
{
|
|
||||||
CAF_CMD_SOURCE_INIT(RicWellLogsImportFileFeature, "RicWellLogsImportFileFeature");
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -65,5 +62,3 @@ void RicWellLogsImportFileFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
actionToSetup->setText("Import Well &Logs from File");
|
actionToSetup->setText("Import Well &Logs from File");
|
||||||
actionToSetup->setIcon(QIcon(":/LasFile16x16.png"));
|
actionToSetup->setIcon(QIcon(":/LasFile16x16.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,17 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicWellLogsImportFileFeature : public CmdFeature
|
class RicWellLogsImportFileFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -20,19 +20,14 @@
|
|||||||
#include "RicWellPathDeleteFeature.h"
|
#include "RicWellPathDeleteFeature.h"
|
||||||
|
|
||||||
#include "RimWellPathCollection.h"
|
#include "RimWellPathCollection.h"
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include "RimWellPath.h"
|
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicWellPathDeleteFeature, "RicWellPathDeleteFeature");
|
CAF_CMD_SOURCE_INIT(RicWellPathDeleteFeature, "RicWellPathDeleteFeature");
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -83,5 +78,3 @@ void RicWellPathDeleteFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
actionToSetup->setText("Delete Well Path(s)");
|
actionToSetup->setText("Delete Well Path(s)");
|
||||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,16 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicWellPathDeleteFeature : public CmdFeature
|
class RicWellPathDeleteFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -32,10 +32,7 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
namespace caf
|
CAF_CMD_SOURCE_INIT(RicWellPathImportCompletionsFileFeature, "RicWellPathImportCompletionsFileFeature");
|
||||||
{
|
|
||||||
CAF_CMD_SOURCE_INIT(RicWellPathImportCompletionsFileFeature, "RicWellPathImportCompletionsFileFeature");
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -88,5 +85,3 @@ void RicWellPathImportCompletionsFileFeature::setupActionLook(QAction* actionToS
|
|||||||
actionToSetup->setText("Import Completions from File");
|
actionToSetup->setText("Import Completions from File");
|
||||||
actionToSetup->setIcon(QIcon(":/Well.png"));
|
actionToSetup->setIcon(QIcon(":/Well.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,17 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicWellPathImportCompletionsFileFeature : public CmdFeature
|
class RicWellPathImportCompletionsFileFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
namespace caf
|
CAF_CMD_SOURCE_INIT(RicWellPathsImportFileFeature, "RicWellPathsImportFileFeature");
|
||||||
{
|
|
||||||
CAF_CMD_SOURCE_INIT(RicWellPathsImportFileFeature, "RicWellPathsImportFileFeature");
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -69,5 +67,3 @@ void RicWellPathsImportFileFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
actionToSetup->setText("Import &Well Paths from File");
|
actionToSetup->setText("Import &Well Paths from File");
|
||||||
actionToSetup->setIcon(QIcon(":/Well.png"));
|
actionToSetup->setIcon(QIcon(":/Well.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,16 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicWellPathsImportFileFeature : public CmdFeature
|
class RicWellPathsImportFileFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -33,9 +33,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
namespace caf
|
CAF_CMD_SOURCE_INIT(RicWellPathsImportSsihubFeature, "RicWellPathsImportSsihubFeature");
|
||||||
{
|
|
||||||
CAF_CMD_SOURCE_INIT(RicWellPathsImportSsihubFeature, "RicWellPathsImportSsihubFeature");
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -125,5 +123,3 @@ void RicWellPathsImportSsihubFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
actionToSetup->setText("Import Well Paths from &SSI-hub");
|
actionToSetup->setText("Import Well Paths from &SSI-hub");
|
||||||
actionToSetup->setIcon(QIcon(":/WellCollection.png"));
|
actionToSetup->setIcon(QIcon(":/WellCollection.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -21,23 +21,16 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicWellPathsImportSsihubFeature : public CmdFeature
|
class RicWellPathsImportSsihubFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual bool isCommandEnabled();
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked );
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook( QAction* actionToSetup );
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
|
||||||
|
@ -312,7 +312,7 @@ void RiuDragDrop::moveCasesToGridGroup(caf::PdmObjectGroup& objectGroup, RimIden
|
|||||||
|
|
||||||
if (RicCloseCaseFeature::userConfirmedGridCaseGroupChange(casesToBeDeleted))
|
if (RicCloseCaseFeature::userConfirmedGridCaseGroupChange(casesToBeDeleted))
|
||||||
{
|
{
|
||||||
caf::RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup);
|
RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup);
|
||||||
|
|
||||||
for (size_t i = 0; i < casesToBeDeleted.size(); i++)
|
for (size_t i = 0; i < casesToBeDeleted.size(); i++)
|
||||||
{
|
{
|
||||||
@ -328,7 +328,7 @@ bool RiuDragDrop::handleGridCaseGroupDrop(Qt::DropAction action, caf::PdmObjectG
|
|||||||
{
|
{
|
||||||
if (action == Qt::CopyAction)
|
if (action == Qt::CopyAction)
|
||||||
{
|
{
|
||||||
caf::RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup);
|
RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup);
|
||||||
}
|
}
|
||||||
else if (action == Qt::MoveAction)
|
else if (action == Qt::MoveAction)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user