///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2020- Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RimLegendConfig.h" #include "cafPdmChildField.h" #include "cafPdmField.h" #include "cafPdmFieldCvfColor.h" // Include to make Pdm work for cvf::Color #include "cafPdmObject.h" #include "RigEclipseResultAddress.h" #include #include class RimRegularLegendConfig; class RiuViewer; //================================================================================================== /// /// //================================================================================================== class RimElementVectorResult : public caf::PdmObject { CAF_PDM_HEADER_INIT; public: enum class TensorColors { UNIFORM_COLOR, RESULT_COLORS }; enum class VectorView { CELL_CENTER_TOTAL, PER_FACE }; enum class VectorSurfaceCrossingLocation { VECTOR_ANCHOR, VECTOR_CENTER }; public: RimElementVectorResult(); ~RimElementVectorResult() override; void setShowResult( bool enableResult ); bool showResult() const; VectorView vectorView() const; bool showOil() const; bool showGas() const; bool showWater() const; bool showVectorI() const; bool showVectorJ() const; bool showVectorK() const; bool showNncData() const; VectorSurfaceCrossingLocation vectorSuraceCrossingLocation() const; double threshold() const; double sizeScale() const; TensorColors vectorColors() const; const cvf::Color3f& getUniformVectorColor() const; const RimRegularLegendConfig* legendConfig() const; void mappingRange( double& min, double& max ) const; bool resultAddressesCombined( std::vector& addresses ) const; bool resultAddressesIJK( std::vector& addresses ) const; void updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer ); private: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; caf::PdmFieldHandle* objectToggleField() override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; private: caf::PdmField m_showResult; caf::PdmField m_showOil; caf::PdmField m_showGas; caf::PdmField m_showWater; caf::PdmField> m_vectorView; caf::PdmField m_showVectorI; caf::PdmField m_showVectorJ; caf::PdmField m_showVectorK; caf::PdmField m_showNncData; caf::PdmField> m_vectorSurfaceCrossingLocation; caf::PdmField m_threshold; caf::PdmField> m_vectorColor; caf::PdmField m_uniformVectorColor; caf::PdmField m_sizeScale; caf::PdmField m_rangeMode; caf::PdmChildField m_legendConfig; };