mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
85 lines
2.7 KiB
C
85 lines
2.7 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 "cvfArray.h"
|
||
|
#include "cvfObject.h"
|
||
|
#include "cvfTransform.h"
|
||
|
#include "cvfVector3.h"
|
||
|
|
||
|
#include "cafPdmPointer.h"
|
||
|
#include "cafTensor3.h"
|
||
|
|
||
|
#include "RimTensorResults.h"
|
||
|
|
||
|
#include <array>
|
||
|
#include <vector>
|
||
|
|
||
|
namespace cvf
|
||
|
{
|
||
|
class ModelBasicList;
|
||
|
class Part;
|
||
|
class ScalarMapper;
|
||
|
class ScalarMapperDiscreteLinear;
|
||
|
} // namespace cvf
|
||
|
|
||
|
class RimEclipseView;
|
||
|
class RimElementVectorResult;
|
||
|
|
||
|
class RivElementVectorResultPartMgr : public cvf::Object
|
||
|
{
|
||
|
public:
|
||
|
RivElementVectorResultPartMgr( RimEclipseView* reservoirView );
|
||
|
~RivElementVectorResultPartMgr() override;
|
||
|
|
||
|
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t timeStepIndex );
|
||
|
void setTransform( cvf::Transform* scaleTransform );
|
||
|
|
||
|
private:
|
||
|
struct ElementVectorResultVisualization
|
||
|
{
|
||
|
ElementVectorResultVisualization( cvf::Vec3d faceCenter, cvf::Vec3d faceNormal, double result )
|
||
|
: faceCenter( faceCenter )
|
||
|
, faceNormal( faceNormal )
|
||
|
, result( result )
|
||
|
{
|
||
|
}
|
||
|
|
||
|
cvf::Vec3f faceCenter;
|
||
|
cvf::Vec3f faceNormal;
|
||
|
double result;
|
||
|
};
|
||
|
|
||
|
private:
|
||
|
cvf::ref<cvf::Part> createPart( const RimElementVectorResult& result,
|
||
|
const std::vector<ElementVectorResultVisualization>& tensorVisualizations ) const;
|
||
|
|
||
|
static void
|
||
|
createResultColorTextureCoords( cvf::Vec2fArray* textureCoords,
|
||
|
const std::vector<ElementVectorResultVisualization>& elementVectorResultVisualizations,
|
||
|
const cvf::ScalarMapper* mapper );
|
||
|
|
||
|
std::array<cvf::Vec3f, 5> createArrowVertices( const ElementVectorResultVisualization& tensorVisualization ) const;
|
||
|
std::array<uint, 8> createArrowIndices( uint startIndex ) const;
|
||
|
|
||
|
private:
|
||
|
caf::PdmPointer<RimEclipseView> m_rimReservoirView;
|
||
|
cvf::ref<cvf::Transform> m_scaleTransform;
|
||
|
};
|