2015-11-16 10:52:38 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-11-16 10:52:38 +01: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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-11-16 10:52:38 +01: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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-11-16 10:52:38 +01:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2015-11-26 16:00:08 +01:00
|
|
|
|
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
|
2021-10-15 16:57:18 +02:00
|
|
|
#include "RivIntersectionGeometryGeneratorInterface.h"
|
2019-11-20 13:01:25 +01:00
|
|
|
|
2015-11-26 16:00:08 +01:00
|
|
|
#include "cvfArray.h"
|
2019-09-05 09:43:17 +02:00
|
|
|
|
2015-11-26 16:00:08 +01:00
|
|
|
#include "cvfBoundingBox.h"
|
2015-11-16 10:52:38 +01:00
|
|
|
#include "cvfObject.h"
|
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2018-04-10 15:35:10 +02:00
|
|
|
#include <QString>
|
|
|
|
|
|
2015-11-16 10:52:38 +01:00
|
|
|
class RigMainGrid;
|
2015-11-27 13:35:17 +01:00
|
|
|
class RigActiveCellInfo;
|
2015-11-16 12:12:42 +01:00
|
|
|
class RigResultAccessor;
|
2019-11-26 11:35:21 +01:00
|
|
|
class RimExtrudedCurveIntersection;
|
2017-01-17 15:11:02 +01:00
|
|
|
class RivIntersectionHexGridInterface;
|
|
|
|
|
class RivIntersectionVertexWeights;
|
2021-08-26 08:13:03 +02:00
|
|
|
class RimSurface;
|
2015-11-16 10:52:38 +01:00
|
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
class ScalarMapper;
|
|
|
|
|
class DrawableGeo;
|
|
|
|
|
} // namespace cvf
|
2015-11-20 12:02:43 +01:00
|
|
|
|
2021-10-15 16:57:18 +02:00
|
|
|
class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface
|
2015-11-16 10:52:38 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2019-11-26 13:56:02 +01:00
|
|
|
RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* intersection,
|
|
|
|
|
std::vector<std::vector<cvf::Vec3d>>& polylines,
|
|
|
|
|
const cvf::Vec3d& extrusionDirection,
|
|
|
|
|
const RivIntersectionHexGridInterface* grid,
|
|
|
|
|
bool isFlattened,
|
|
|
|
|
const cvf::Vec3d& flattenedPolylineStartPoint );
|
2015-11-16 10:52:38 +01:00
|
|
|
|
2019-11-26 11:51:54 +01:00
|
|
|
~RivExtrudedCurveIntersectionGeometryGenerator() override;
|
2015-12-03 12:54:13 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
// Generate geometry
|
|
|
|
|
cvf::ref<cvf::DrawableGeo> generateSurface();
|
|
|
|
|
cvf::ref<cvf::DrawableGeo> createMeshDrawable();
|
|
|
|
|
cvf::ref<cvf::DrawableGeo> createFaultMeshDrawable();
|
|
|
|
|
|
|
|
|
|
cvf::ref<cvf::DrawableGeo> createLineAlongPolylineDrawable();
|
|
|
|
|
cvf::ref<cvf::DrawableGeo> createLineAlongExtrusionLineDrawable( const std::vector<cvf::Vec3d>& extrusionLine );
|
|
|
|
|
cvf::ref<cvf::DrawableGeo> createPointsFromPolylineDrawable();
|
|
|
|
|
cvf::ref<cvf::DrawableGeo> createPointsFromExtrusionLineDrawable( const std::vector<cvf::Vec3d>& extrusionLine );
|
|
|
|
|
|
2021-08-26 08:13:03 +02:00
|
|
|
const std::vector<std::pair<QString, cvf::Vec3d>>& faultMeshLabelAndAnchorPositions();
|
2015-11-26 16:00:08 +01:00
|
|
|
|
2020-04-07 14:28:55 +02:00
|
|
|
cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const;
|
2018-02-16 14:37:59 +01:00
|
|
|
|
2019-11-20 13:59:16 +01:00
|
|
|
// GeomGen Interface
|
|
|
|
|
bool isAnyGeometryPresent() const override;
|
|
|
|
|
|
2021-08-26 08:13:03 +02:00
|
|
|
std::map<RimSurface*, std::vector<cvf::Vec3d>> transformedSurfaceIntersectionPolylines() const;
|
|
|
|
|
|
2019-11-20 13:59:16 +01:00
|
|
|
const std::vector<size_t>& triangleToCellIndex() const override;
|
|
|
|
|
const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const override;
|
|
|
|
|
const cvf::Vec3fArray* triangleVxes() const override;
|
2022-04-04 12:06:01 +02:00
|
|
|
const cvf::Vec3fArray* cellMeshVxes() const override;
|
|
|
|
|
const cvf::Vec3fArray* faultMeshVxes() const override;
|
|
|
|
|
|
|
|
|
|
void ensureGeometryIsCalculated();
|
2019-11-20 13:59:16 +01:00
|
|
|
|
2015-11-16 10:52:38 +01:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
void calculateArrays();
|
2021-08-26 08:13:03 +02:00
|
|
|
void calculateLineSegementTransforms();
|
|
|
|
|
void calculateTransformedPolyline();
|
|
|
|
|
void calculateSurfaceIntersectionPoints();
|
|
|
|
|
|
|
|
|
|
RimExtrudedCurveIntersection* intersection() const;
|
2018-02-05 16:13:07 +01:00
|
|
|
|
2021-08-26 08:13:03 +02:00
|
|
|
const std::vector<std::vector<cvf::Vec3d>>& flattenedOrOffsettedPolyLines();
|
|
|
|
|
cvf::Vec3d transformPointByPolylineSegmentIndex( const cvf::Vec3d& domainCoord, size_t lineIndex, size_t segmentIndex );
|
|
|
|
|
|
|
|
|
|
static std::vector<std::pair<cvf::Vec3d, size_t>> computeResampledPolyline( const std::vector<cvf::Vec3d>& polyline,
|
2023-02-26 10:48:40 +01:00
|
|
|
double resamplingDistance );
|
2021-08-26 08:13:03 +02:00
|
|
|
|
|
|
|
|
private:
|
2019-11-26 13:56:02 +01:00
|
|
|
RimExtrudedCurveIntersection* m_intersection;
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid;
|
2021-08-26 08:13:03 +02:00
|
|
|
const std::vector<std::vector<cvf::Vec3d>> m_polylines;
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::Vec3d m_extrusionDirection;
|
|
|
|
|
bool m_isFlattened;
|
|
|
|
|
cvf::Vec3d m_flattenedPolylineStartPoint;
|
|
|
|
|
|
|
|
|
|
// Output arrays
|
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_cellBorderLineVxes;
|
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_faultCellBorderLineVxes;
|
|
|
|
|
std::vector<size_t> m_triangleToCellIdxMap;
|
|
|
|
|
std::vector<RivIntersectionVertexWeights> m_triVxToCellCornerWeights;
|
2021-08-26 08:13:03 +02:00
|
|
|
std::vector<std::vector<cvf::Vec3d>> m_transformedPolyLines;
|
|
|
|
|
std::vector<std::vector<cvf::Mat4d>> m_lineSegmentTransforms;
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
std::vector<std::pair<QString, cvf::Vec3d>> m_faultMeshLabelAndAnchorPositions;
|
2021-08-26 08:13:03 +02:00
|
|
|
|
|
|
|
|
std::map<RimSurface*, std::vector<cvf::Vec3d>> m_transformedSurfaceIntersectionPolylines;
|
2015-11-16 10:52:38 +01:00
|
|
|
};
|