Files
ResInsight/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h
T
Magne Sjaastad ac594eb54e Add SurfaceColorMode setting to control surface visualization
Add a Color Mode dropdown to surfaces and surface collections that
controls how surfaces are rendered:
- Both: Show surface color and cell result colors
- Surface Color: Show only the uniform surface color
- Cell Result Colors: Show only cell results mapped to surface

Individual surfaces default to inherit from their parent collection but can override with their own setting.
2026-01-26 11:36:26 +01:00

99 lines
3.2 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimIntersection.h"
#include "cafAppEnum.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmProxyValueField.h"
#include "cafPdmPtrField.h"
#include "cvfObject.h"
class RimSurface;
class RimSurfaceResultDefinition;
class RivSurfacePartMgr;
class RivIntersectionHexGridInterface;
class RiuViewer;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RimSurfaceInView : public RimIntersection
{
CAF_PDM_HEADER_INIT;
public:
enum class SurfaceColorMode
{
DEFAULT,
BOTH,
SURFACE_COLOR,
RESULT_COLORS
};
public:
RimSurfaceInView();
~RimSurfaceInView() override;
QString name() const override;
RimSurface* surface() const;
void setSurface( RimSurface* surf );
SurfaceColorMode surfaceColorMode() const;
SurfaceColorMode effectiveSurfaceColorMode() const;
bool isNativeSurfaceResultsActive() const;
RimSurfaceResultDefinition* surfaceResultDefinition();
void clearGeometry();
RivSurfacePartMgr* surfacePartMgr();
RivSurfacePartMgr* nativeSurfacePartMgr();
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
void loadDataAndUpdate( int timeStep );
void updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer );
void setMeshLinesEnabled( bool meshLinesEnabled );
bool isMeshLinesEnabled() const;
protected:
void initAfterRead() override;
private:
RimIntersectionResultsDefinitionCollection* findSeparateResultsCollection() override;
caf::PdmFieldHandle* userDescriptionField() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
caf::PdmProxyValueField<QString> m_name;
caf::PdmPtrField<RimSurface*> m_surface;
caf::PdmField<bool> m_showMeshLines;
caf::PdmField<caf::AppEnum<SurfaceColorMode>> m_surfaceColorMode;
caf::PdmChildField<RimSurfaceResultDefinition*> m_resultDefinition;
cvf::ref<RivSurfacePartMgr> m_surfacePartMgr;
};