Project tree: Fixed several issues after the reconfiguration

Missing Icon and text on the Grid Models folder
New cases and Grid Case Groups ended up outside the Grid Model Folder
Old Project files did not show up properly
p4#: 21854
This commit is contained in:
Jacob Støren
2013-06-07 14:54:02 +02:00
parent 080fc4c094
commit 6ac8c4365f
6 changed files with 20 additions and 19 deletions

View File

@@ -565,12 +565,8 @@ bool RiaApplication::openEclipseCase(const QString& caseName, const QString& cas
}
RimUiTreeModelPdm* uiModel = RiuMainWindow::instance()->uiPdmModel();
caf::PdmUiTreeItem* projectTreeItem = uiModel->treeItemRoot();
// New case is inserted before the last item, the script item
int position = projectTreeItem->childCount() - 1;
uiModel->addToParentAndBuildUiItems(projectTreeItem, position, rimResultReservoir);
uiModel->updateUiSubTree(analysisModels);
RiuMainWindow::instance()->setCurrentObjectInTreeView(riv->cellResult());
@@ -607,12 +603,7 @@ bool RiaApplication::openInputEclipseCase(const QString& caseName, const QString
}
RimUiTreeModelPdm* uiModel = RiuMainWindow::instance()->uiPdmModel();
caf::PdmUiTreeItem* projectTreeItem = uiModel->treeItemRoot();
// New case is inserted before the last item, the script item
int position = projectTreeItem->childCount() - 1;
uiModel->addToParentAndBuildUiItems(projectTreeItem, position, rimInputReservoir);
uiModel->updateUiSubTree(analysisModels);
RiuMainWindow::instance()->setCurrentObjectInTreeView(riv->cellResult());
@@ -1533,12 +1524,8 @@ bool RiaApplication::addEclipseCases(const QStringList& fileNames)
}
RimUiTreeModelPdm* uiModel = RiuMainWindow::instance()->uiPdmModel();
caf::PdmUiTreeItem* projectTreeItem = uiModel->treeItemRoot();
// New case is inserted before the last item, the script item
int position = projectTreeItem->childCount() - 1;
uiModel->addToParentAndBuildUiItems(projectTreeItem, position, gridCaseGroup);
uiModel->updateUiSubTree( m_project->activeOilField()->analysisModels());
if (gridCaseGroup->statisticsCaseCollection()->reservoirs.size() > 0)
{

View File

@@ -55,6 +55,8 @@ CAF_PDM_SOURCE_INIT(RimAnalysisModels, "ResInsightAnalysisModels");
//--------------------------------------------------------------------------------------------------
RimAnalysisModels::RimAnalysisModels(void)
{
CAF_PDM_InitObject("Grid Models", ":/GridModels.png", "", "");
CAF_PDM_InitFieldNoDefault(&cases, "Reservoirs", "", "", "", "");
CAF_PDM_InitFieldNoDefault(&caseGroups, "CaseGroups", "", "", "", "");

View File

@@ -51,8 +51,10 @@ CAF_PDM_SOURCE_INIT(RimOilField, "ResInsightOilField");
//--------------------------------------------------------------------------------------------------
RimOilField::RimOilField(void)
{
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
CAF_PDM_InitObject("Oil Field", "", "", "");
CAF_PDM_InitFieldNoDefault(&analysisModels, "AnalysisModels", "Grid Models", ":/GridModels.png", "", "");
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
analysisModels = new RimAnalysisModels();
}

View File

@@ -84,6 +84,9 @@ RimProject::RimProject(void)
scriptCollection = new RimScriptCollection();
scriptCollection->directory.setUiHidden(true);
// For now, create a default first oilfield that contains the rest of the project
oilFields.push_back(new RimOilField);
initScriptDirectories();
}

View File

@@ -39,6 +39,7 @@
<file>SnapShotSaveViews.png</file>
<file>draw_style_faults_24x24.png</file>
<file>Case48x48.png</file>
<file>GridModels.png</file>
</qresource>
<qresource prefix="/Shader/">
<file>fs_CellFace.glsl</file>

View File

@@ -525,8 +525,14 @@ PdmUiTreeItem* UiTreeItemBuilderPdm::buildViewItems(PdmUiTreeItem* parentTreeIte
return NULL;
}
// NOTE: if position is -1, the item is appended to the parent tree item
PdmUiTreeItem* objectTreeItem = NULL;
// Ignore this particular object if the field it resides in is hidden.
// Child objects of this object, however, is not hidden
// Todo: This is a Hack to make oilField disappear. Must be rewritten when
// a more general ui tree building method is in place.
std::vector<caf::PdmFieldHandle*> parentFields;
object->parentFields(parentFields);
if (parentFields.size() == 1 && parentFields[0]->isUiHidden())