adjustments

This commit is contained in:
Magne Sjaastad 2019-03-19 09:43:11 +01:00
parent 924916fdd7
commit 2a1d8379a5
4 changed files with 26 additions and 12 deletions

View File

@ -36,7 +36,7 @@ CAF_PDM_ABSTRACT_SOURCE_INIT(RimPlotCellFilter, "RimPlotCellFilter");
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimPlotCellFilter::RimPlotCellFilter() RimPlotCellFilter::RimPlotCellFilter()
{ {
CAF_PDM_InitFieldNoDefault(&m_filterType, "FilterType", "Filter Type", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_filterMode, "FilterMode", "Filter Mode", "", "", "");
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -50,7 +50,7 @@ void RimPlotCellFilter::updateCellVisibility(size_t timeStepIndex, cvf::UByteArr
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimPlotCellFilter::FilterModeType RimPlotCellFilter::filterType() const RimPlotCellFilter::FilterModeType RimPlotCellFilter::filterMode() const
{ {
return m_filterType(); return m_filterMode();
} }

View File

@ -41,11 +41,11 @@ public:
RimPlotCellFilter(); RimPlotCellFilter();
void updateCellVisibility(size_t timeStepIndex, cvf::UByteArray* cellVisibility); void updateCellVisibility(size_t timeStepIndex, cvf::UByteArray* cellVisibility);
FilterModeType filterType() const; FilterModeType filterMode() const;
protected: protected:
virtual void updateCellVisibilityFromFilter(size_t timeStepIndex, cvf::UByteArray* cellVisibility) = 0; virtual void updateCellVisibilityFromFilter(size_t timeStepIndex, cvf::UByteArray* cellVisibility) = 0;
private: private:
caf::PdmField<caf::AppEnum<FilterModeType>> m_filterType; caf::PdmField<caf::AppEnum<FilterModeType>> m_filterMode;
}; };

View File

@ -128,14 +128,14 @@ void RimPlotCellPropertyFilter::updateCellVisibilityFromFilter(size_t timeStepIn
double scalarValue = cellResultValues[cellResultIndex]; double scalarValue = cellResultValues[cellResultIndex];
if (lowerBound <= scalarValue && scalarValue <= upperBound) if (lowerBound <= scalarValue && scalarValue <= upperBound)
{ {
if (filterType() == RimPlotCellFilter::EXCLUDE) if (filterMode() == RimPlotCellFilter::EXCLUDE)
{ {
(*visibleCells)[reservoirCellIndex] = false; (*visibleCells)[reservoirCellIndex] = false;
} }
} }
else else
{ {
if (filterType() == RimPlotCellFilter::INCLUDE) if (filterMode() == RimPlotCellFilter::INCLUDE)
{ {
(*visibleCells)[reservoirCellIndex] = false; (*visibleCells)[reservoirCellIndex] = false;
} }

View File

@ -1,13 +1,27 @@
@startuml @startuml
package Rim {
PdmObject <|-- RimPlotCellFilter PdmObject <|-- RimPlotCellFilter
RimPlotCellFilter <|-- RimPlotCellRangeFilter
RimPlotCellFilter <|-- RimPlotCellPropertyFilter
RimPlotCellFilter <|-- RimPlotCellRegionFilter
class RimPlotCellFilter class RimPlotCellFilter
{ {
bool isCellAcceptedByFilter(size_t reservoirCellIndex); void updateCellVisibilityFromFilter(size_t timeStepIndex,
cvf::UByteArray* cellVisibility)
FilterModeType filterMode() const;
} }
RimPlotCellFilter <|-- RimPlotCellPropertyFilter
RimPlotCellFilter <|-- RimPlotCellFilterCollection
RimPlotCellFilterCollection -> RimPlotCellFilter
class RimPlotCellFilterCollection
{
std::vector<RimCellFilter*> m_filters
}
RimPlotCellFilter <|-- RimPlotCellRegionFilter_planned
RimPlotCellFilter <|-- RimPlotCellRangeFilter_planned
@enduml @enduml