Refactoring more general stuff into RimView

updateViewerWidget
scheduleUpdateDisplayModelAndRedraw
This commit is contained in:
Jacob Støren
2015-04-30 10:34:15 +02:00
parent 4b7d593b3c
commit 3dac8807c7
10 changed files with 165 additions and 177 deletions

View File

@@ -1969,7 +1969,7 @@ QString RiaApplication::commandLineParameterHelp() const
/// Schedule a creation of the Display model and redraw of the reservoir view
/// The redraw will happen as soon as the event loop is entered
//--------------------------------------------------------------------------------------------------
void RiaApplication::scheduleDisplayModelUpdateAndRedraw(RimReservoirView* resViewToUpdate)
void RiaApplication::scheduleDisplayModelUpdateAndRedraw(RimView* resViewToUpdate)
{
m_resViewsToUpdate.push_back(resViewToUpdate);
@@ -1992,13 +1992,13 @@ void RiaApplication::scheduleDisplayModelUpdateAndRedraw(RimReservoirView* resVi
void RiaApplication::slotUpdateScheduledDisplayModels()
{
// Compress to remove duplicates
std::set<RimReservoirView*> resViewsToUpdate;
std::set<RimView*> resViewsToUpdate;
for (size_t i = 0; i < m_resViewsToUpdate.size(); ++i)
{
resViewsToUpdate.insert(m_resViewsToUpdate[i]);
}
for (std::set<RimReservoirView*>::iterator it = resViewsToUpdate.begin(); it != resViewsToUpdate.end(); ++it )
for (std::set<RimView*>::iterator it = resViewsToUpdate.begin(); it != resViewsToUpdate.end(); ++it )
{
if (*it)
{

View File

@@ -38,6 +38,7 @@ class Drawable;
class RiaSocketServer;
class RiaPreferences;
class RimReservoirView;
class RimView;
class RimProject;
class RimCommandObject;
class RiaProjectModifier;
@@ -76,7 +77,7 @@ public:
RimReservoirView* activeReservoirView();
const RimReservoirView* activeReservoirView() const;
void scheduleDisplayModelUpdateAndRedraw(RimReservoirView* resViewToUpdate);
void scheduleDisplayModelUpdateAndRedraw(RimView* resViewToUpdate);
RimProject* project();
@@ -174,7 +175,7 @@ private:
caf::PdmPointer<RimReservoirView> m_activeReservoirView;
caf::PdmPointer<RimProject> m_project;
std::vector<caf::PdmPointer<RimReservoirView> > m_resViewsToUpdate;
std::vector<caf::PdmPointer<RimView> > m_resViewsToUpdate;
QTimer* m_resViewUpdateTimer;
RiaSocketServer* m_socketServer;