2015-11-16 03:52:38 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-11-16 03:52:38 -06: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 03:40:57 -05:00
|
|
|
//
|
2015-11-16 03:52:38 -06: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 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-11-16 03:52:38 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
2015-11-26 09:00:08 -06:00
|
|
|
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
2021-10-15 09:57:18 -05:00
|
|
|
#include "RivIntersectionGeometryGeneratorInterface.h"
|
2019-11-20 06:01:25 -06:00
|
|
|
|
2015-11-26 09:00:08 -06:00
|
|
|
#include "cvfArray.h"
|
2019-09-05 02:43:17 -05:00
|
|
|
|
2015-11-26 09:00:08 -06:00
|
|
|
#include "cvfBoundingBox.h"
|
2015-11-16 03:52:38 -06:00
|
|
|
#include "cvfObject.h"
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2018-04-10 08:35:10 -05:00
|
|
|
#include <QString>
|
|
|
|
|
2015-11-16 03:52:38 -06:00
|
|
|
class RigMainGrid;
|
2015-11-27 06:35:17 -06:00
|
|
|
class RigActiveCellInfo;
|
2015-11-16 05:12:42 -06:00
|
|
|
class RigResultAccessor;
|
2019-11-26 04:35:21 -06:00
|
|
|
class RimExtrudedCurveIntersection;
|
2017-01-17 08:11:02 -06:00
|
|
|
class RivIntersectionHexGridInterface;
|
|
|
|
class RivIntersectionVertexWeights;
|
2021-08-26 01:13:03 -05:00
|
|
|
class RimSurface;
|
2015-11-16 03:52:38 -06:00
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
class ScalarMapper;
|
|
|
|
class DrawableGeo;
|
|
|
|
} // namespace cvf
|
2015-11-20 05:02:43 -06:00
|
|
|
|
2021-10-15 09:57:18 -05:00
|
|
|
class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface
|
2015-11-16 03:52:38 -06:00
|
|
|
{
|
|
|
|
public:
|
2019-11-26 06:56:02 -06: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 03:52:38 -06:00
|
|
|
|
2019-11-26 04:51:54 -06:00
|
|
|
~RivExtrudedCurveIntersectionGeometryGenerator() override;
|
2015-12-03 05:54:13 -06:00
|
|
|
|
2019-09-06 03:40:57 -05: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 01:13:03 -05:00
|
|
|
const std::vector<std::pair<QString, cvf::Vec3d>>& faultMeshLabelAndAnchorPositions();
|
2015-11-26 09:00:08 -06:00
|
|
|
|
2020-04-07 07:28:55 -05:00
|
|
|
cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const;
|
2018-02-16 07:37:59 -06:00
|
|
|
|
2019-11-20 06:59:16 -06:00
|
|
|
// GeomGen Interface
|
|
|
|
bool isAnyGeometryPresent() const override;
|
|
|
|
|
2021-08-26 01:13:03 -05:00
|
|
|
std::map<RimSurface*, std::vector<cvf::Vec3d>> transformedSurfaceIntersectionPolylines() const;
|
|
|
|
|
2019-11-20 06:59:16 -06: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 05:06:01 -05:00
|
|
|
const cvf::Vec3fArray* cellMeshVxes() const override;
|
|
|
|
const cvf::Vec3fArray* faultMeshVxes() const override;
|
|
|
|
|
|
|
|
void ensureGeometryIsCalculated();
|
2019-11-20 06:59:16 -06:00
|
|
|
|
2015-11-16 03:52:38 -06:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
void calculateArrays();
|
2021-08-26 01:13:03 -05:00
|
|
|
void calculateLineSegementTransforms();
|
|
|
|
void calculateTransformedPolyline();
|
|
|
|
void calculateSurfaceIntersectionPoints();
|
|
|
|
|
|
|
|
RimExtrudedCurveIntersection* intersection() const;
|
2018-02-05 09:13:07 -06:00
|
|
|
|
2021-08-26 01:13:03 -05: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,
|
|
|
|
double resamplingDistance );
|
|
|
|
|
|
|
|
private:
|
2019-11-26 06:56:02 -06:00
|
|
|
RimExtrudedCurveIntersection* m_intersection;
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid;
|
2021-08-26 01:13:03 -05:00
|
|
|
const std::vector<std::vector<cvf::Vec3d>> m_polylines;
|
2019-09-06 03:40:57 -05: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 01:13:03 -05:00
|
|
|
std::vector<std::vector<cvf::Vec3d>> m_transformedPolyLines;
|
|
|
|
std::vector<std::vector<cvf::Mat4d>> m_lineSegmentTransforms;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
std::vector<std::pair<QString, cvf::Vec3d>> m_faultMeshLabelAndAnchorPositions;
|
2021-08-26 01:13:03 -05:00
|
|
|
|
|
|
|
std::map<RimSurface*, std::vector<cvf::Vec3d>> m_transformedSurfaceIntersectionPolylines;
|
2015-11-16 03:52:38 -06:00
|
|
|
};
|