Skip to content

Commit

Permalink
(#396) Adding a trace when creating a new well log plot
Browse files Browse the repository at this point in the history
Did some refactoring - moved creation code to command feature.
  • Loading branch information
palhagen committed Sep 3, 2015
1 parent 2288130 commit bcab7f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
12 changes: 11 additions & 1 deletion ApplicationCode/Commands/RicNewWellLogPlotFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
#include "RimProject.h"
#include "RimMainPlotCollection.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotTrace.h"

#include "RiaApplication.h"
#include "RiuMainWindow.h"

#include <QAction>

Expand All @@ -46,7 +49,14 @@ void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
if (wellLogPlotColl)
{
wellLogPlotColl->addWellLogPlot();
RimWellLogPlot* plot = new RimWellLogPlot();
RimWellLogPlotTrace* plotrace = new RimWellLogPlotTrace();

plot->addTrace(plotrace);
wellLogPlotColl->wellLogPlots().push_back(plot);

RiaApplication::instance()->project()->updateConnectedEditors();
RiuMainWindow::instance()->setCurrentObjectInTreeView(plot);
}
}

Expand Down
17 changes: 0 additions & 17 deletions ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
#include "RimWellLogPlotCollection.h"

#include "RimWellLogPlot.h"
#include "RimProject.h"

#include "RiuMainWindow.h"

#include "RiaApplication.h"

#include "cafPdmUiTreeView.h"

Expand All @@ -48,15 +43,3 @@ RimWellLogPlotCollection::~RimWellLogPlotCollection()
{
wellLogPlots.deleteAllChildObjects();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotCollection::addWellLogPlot()
{
RimWellLogPlot* plot = new RimWellLogPlot();
wellLogPlots.push_back(plot);

RiaApplication::instance()->project()->updateConnectedEditors();
RiuMainWindow::instance()->setCurrentObjectInTreeView(plot);
}
5 changes: 0 additions & 5 deletions ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,4 @@ class RimWellLogPlotCollection : public caf::PdmObject
virtual ~RimWellLogPlotCollection();

caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;

void addWellLogPlot();

private:
caf::PdmField<bool> show;
};

0 comments on commit bcab7f2

Please sign in to comment.