Files
ResInsight/ApplicationCode/ModelVisualization/RivGridPartMgr.h
T

98 lines
3.2 KiB
C++
Raw Normal View History

2012-05-18 09:45:23 +02:00
/////////////////////////////////////////////////////////////////////////////////
//
2014-09-23 15:04:57 +02:00
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
2012-05-18 09:45:23 +02:00
// 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.
//
2012-05-18 09:45:23 +02:00
// 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>
2012-05-18 09:45:23 +02:00
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
2018-09-12 14:24:24 +02:00
#include "RigGridBase.h"
#include "RivCellSetEnum.h"
#include "cafPdmPointer.h"
#include "cvfObject.h"
2012-05-18 09:45:23 +02:00
#include "cvfStructGridGeometryGenerator.h"
namespace cvf
{
class StructGridInterface;
class ModelBasicList;
class Transform;
class Part;
class Effect;
} // namespace cvf
2012-05-18 09:45:23 +02:00
class RimEclipseCellColors;
class RimCellEdgeColors;
class RimEclipseCase;
class RivSourceInfo;
2012-05-18 09:45:23 +02:00
//==================================================================================================
///
/// RivGridGeometry: Class to handle visualization structures that embodies a specific grid at a specific time step.
/// frame on a certain level
/// LGR's have their own instance and the parent grid as well
///
//==================================================================================================
class RivGridPartMgr : public cvf::Object
2012-05-18 09:45:23 +02:00
{
public:
RivGridPartMgr( RivCellSetEnum cellSetType, RimEclipseCase* eclipseCase, const RigGridBase* grid, size_t gridIdx );
~RivGridPartMgr() override;
2012-05-18 09:45:23 +02:00
void setTransform( cvf::Transform* scaleTransform );
void setCellVisibility( cvf::UByteArray* cellVisibilities );
cvf::ref<cvf::UByteArray> cellVisibility() { return m_cellVisibility; }
void updateCellColor( cvf::Color4f color );
void updateCellResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
2012-05-18 09:45:23 +02:00
void updateCellEdgeResultColor( size_t timeStepIndex,
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors );
void appendPartsToModel( cvf::ModelBasicList* model );
2012-05-18 09:45:23 +02:00
private:
void generatePartGeometry( cvf::StructGridGeometryGenerator& geoBuilder );
2012-05-18 09:45:23 +02:00
private:
size_t m_gridIdx;
cvf::cref<RigGridBase> m_grid;
cvf::ref<cvf::Transform> m_scaleTransform;
float m_opacityLevel;
cvf::Color3f m_defaultColor;
2012-05-18 09:45:23 +02:00
// Surface visualization
cvf::StructGridGeometryGenerator m_surfaceGenerator;
RigGridCellFaceVisibilityFilter m_surfaceFaceFilter;
cvf::ref<cvf::Part> m_surfaceFaces;
cvf::ref<cvf::Vec2fArray> m_surfaceFacesTextureCoords;
2012-05-18 09:45:23 +02:00
cvf::ref<cvf::Part> m_surfaceGridLines;
2012-05-18 09:45:23 +02:00
cvf::ref<cvf::UByteArray> m_cellVisibility;
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
RivCellSetEnum m_cellSetType;
2012-05-18 09:45:23 +02:00
};