2018-03-14 03:35:48 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-01-09 08:21:38 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-03-14 03:35:48 -05: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.
|
|
|
|
//
|
|
|
|
// 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 "cvfObject.h"
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
2018-03-15 15:25:54 -05:00
|
|
|
class DrawableGeo;
|
2018-04-05 06:54:15 -05:00
|
|
|
class Part;
|
|
|
|
class ScalarMapper;
|
2018-03-14 03:35:48 -05:00
|
|
|
} // namespace cvf
|
|
|
|
|
2018-03-15 15:25:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-03-15 13:09:23 -05:00
|
|
|
struct CompletionVizData
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CompletionVizData( const cvf::Vec3d& anchor, const cvf::Vec3d& direction, double connectionFactor, size_t globalCellIndex )
|
|
|
|
: m_anchor( anchor )
|
|
|
|
, m_direction( direction )
|
|
|
|
, m_connectionFactor( connectionFactor )
|
|
|
|
, m_globalCellIndex( globalCellIndex )
|
2018-03-15 13:09:23 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
cvf::Vec3d m_anchor;
|
|
|
|
cvf::Vec3d m_direction;
|
|
|
|
double m_connectionFactor;
|
2018-03-15 15:25:54 -05:00
|
|
|
size_t m_globalCellIndex;
|
2018-03-15 13:09:23 -05:00
|
|
|
};
|
|
|
|
|
2018-03-14 03:35:48 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-03-15 15:25:54 -05:00
|
|
|
class RivWellConnectionFactorGeometryGenerator : public cvf::Object
|
2018-03-14 03:35:48 -05:00
|
|
|
{
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
RivWellConnectionFactorGeometryGenerator( std::vector<CompletionVizData>& completionVizData, float radius );
|
2018-10-18 12:45:57 -05:00
|
|
|
~RivWellConnectionFactorGeometryGenerator() override;
|
2018-03-14 03:35:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<cvf::Part> createSurfacePart( const cvf::ScalarMapper* scalarMapper, bool disableLighting );
|
2018-03-14 03:35:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
double connectionFactor( cvf::uint triangleIndex ) const;
|
|
|
|
size_t globalCellIndexFromTriangleIndex( cvf::uint triangleIndex ) const;
|
2018-03-14 04:59:03 -05:00
|
|
|
|
2018-03-15 15:25:54 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t mapFromTriangleToConnectionIndex( cvf::uint triangleIndex ) const;
|
2018-04-05 06:54:15 -05:00
|
|
|
cvf::ref<cvf::DrawableGeo> createSurfaceGeometry();
|
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
static void createStarGeometry( std::vector<cvf::Vec3f>* vertices, std::vector<cvf::uint>* indices, float radius, float thickness );
|
2018-03-15 13:09:23 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
static void
|
|
|
|
createSimplifiedStarGeometry( std::vector<cvf::Vec3f>* vertices, std::vector<cvf::uint>* indices, float radius, float thickness );
|
2018-03-16 09:58:04 -05:00
|
|
|
|
2018-03-14 03:35:48 -05:00
|
|
|
private:
|
2018-03-19 08:41:46 -05:00
|
|
|
std::vector<CompletionVizData> m_completionVizData;
|
2018-03-15 15:25:54 -05:00
|
|
|
float m_radius;
|
|
|
|
size_t m_trianglesPerConnection;
|
2018-03-14 03:35:48 -05:00
|
|
|
};
|