From 7f01481393c94b52f300edcc351520e20a372835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Mon, 25 Feb 2013 09:44:26 +0100 Subject: [PATCH] Refurbished the RimReservoirView header file, to make it more readable p4#: 20610 --- .../ProjectDataModel/RimReservoirView.h | 137 +++++++++--------- 1 file changed, 70 insertions(+), 67 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.h b/ApplicationCode/ProjectDataModel/RimReservoirView.h index 2dcb730882..4cbd6db5ad 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.h +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.h @@ -85,97 +85,100 @@ public: NO_SURFACE }; - // Public fields: + // Fields containing child objects : - caf::PdmField cellResult; - caf::PdmField cellEdgeResult; - caf::PdmField overlayInfoConfig; + caf::PdmField cellResult; + caf::PdmField cellEdgeResult; - caf::PdmField scaleZ; - caf::PdmField showWindow; - caf::PdmField name; + caf::PdmField rangeFilterCollection; + caf::PdmField propertyFilterCollection; - // Visibility - caf::PdmField showInvalidCells; - caf::PdmField showInactiveCells; - caf::PdmField showMainGrid; + caf::PdmField wellCollection; - caf::PdmField wellCollection; + caf::PdmField overlayInfoConfig; - caf::PdmField rangeFilterCollection; - caf::PdmField propertyFilterCollection; + // Visualization setup fields - caf::PdmField< caf::AppEnum< MeshModeType > > meshMode; - caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode; + caf::PdmField name; + caf::PdmField scaleZ; + caf::PdmField showWindow; + + caf::PdmField showInvalidCells; + caf::PdmField showInactiveCells; + caf::PdmField showMainGrid; + + caf::PdmField< caf::AppEnum< MeshModeType > > meshMode; + caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode; + + caf::PdmField cameraPosition; + + caf::PdmField maximumFrameRate; + caf::PdmField animationMode; + + // Access internal objects + RigReservoirCellResults* gridCellResults(); + + void setEclipseCase(RimReservoir* reservoir); + RimReservoir* eclipseCase(); // Animation - caf::PdmField maximumFrameRate; - caf::PdmField animationMode; - - int currentTimeStep() { return m_currentTimeStep;} - void setCurrentTimeStep(int frameIdx); - void updateCurrentTimeStepAndRedraw(); - void endAnimation(); + int currentTimeStep() { return m_currentTimeStep;} + void setCurrentTimeStep(int frameIdx); + void updateCurrentTimeStepAndRedraw(); + void endAnimation(); // 3D Viewer - // Cam pos should be a field, but is not yet supported bu caf::Pdm - caf::PdmField cameraPosition; - void setDefaultView(); - - RIViewer* viewer(); - void updateViewerWidget(); - void updateViewerWidgetWindowTitle(); + RIViewer* viewer(); + void updateViewerWidget(); + void updateViewerWidgetWindowTitle(); + void setDefaultView(); // Picking info - bool pickInfo(size_t gridIndex, size_t cellIndex, const cvf::Vec3d& point, QString* pickInfoText) const; - void appendCellResultInfo(size_t gridIndex, size_t cellIndex, QString* resultInfoText) const; - - RigReservoirCellResults* gridCellResults(); - - void setEclipseCase(RimReservoir* reservoir); - RimReservoir* eclipseCase(); - - void calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleCells, RigGridBase * grid); + bool pickInfo(size_t gridIndex, size_t cellIndex, const cvf::Vec3d& point, QString* pickInfoText) const; + void appendCellResultInfo(size_t gridIndex, size_t cellIndex, QString* resultInfoText) const; + // Does this belong here, really ? + void calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleCells, RigGridBase * grid); // Display model generation public: - void loadDataAndUpdate(); - void createDisplayModelAndRedraw(); - void scheduleGeometryRegen(unsigned short geometryType); - void schedulePipeGeometryRegen(); + void loadDataAndUpdate(); + void createDisplayModelAndRedraw(); + void scheduleGeometryRegen(unsigned short geometryType); + void schedulePipeGeometryRegen(); + + // Display model generation +private: + void createDisplayModel(); + void updateDisplayModelVisibility(); + void updateCurrentTimeStep(); + void indicesToVisibleGrids(std::vector* gridIndices); + void updateScaleTransform(); + void updateStaticCellColors(); + void updateStaticCellColors(unsigned short geometryType); + void updateLegends(); + + cvf::ref m_geometry; + cvf::ref m_pipesPartManager; // Overridden PDM methods: public: - virtual caf::PdmFieldHandle* userDescriptionField() { return &name;} - virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); + virtual caf::PdmFieldHandle* userDescriptionField() { return &name;} + virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); protected: - virtual void initAfterRead(); - virtual void setupBeforeSave(); + virtual void initAfterRead(); + virtual void setupBeforeSave(); + // Really private +private: + void syncronizeWellsWithResults(); + void clampCurrentTimestep(); private: - void syncronizeWellsWithResults(); - void clampCurrentTimestep(); - -private: - caf::PdmField m_currentTimeStep; - QPointer m_viewer; - caf::PdmPointer m_reservoir; + caf::PdmField m_currentTimeStep; + QPointer m_viewer; + caf::PdmPointer m_reservoir; -// Display model generation -private: - void createDisplayModel(); - void updateDisplayModelVisibility(); - void updateCurrentTimeStep(); - void indicesToVisibleGrids(std::vector* gridIndices); - void updateScaleTransform(); - void updateStaticCellColors(); - void updateStaticCellColors(unsigned short geometryType); - void updateLegends(); - - cvf::ref m_geometry; - cvf::ref m_pipesPartManager; };