2015-11-16 03:52:38 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
|
|
|
//
|
|
|
|
// 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
|
2015-11-26 09:00:08 -06:00
|
|
|
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
|
|
|
#include "cvfArray.h"
|
2015-11-18 08:29:10 -06:00
|
|
|
#include "cvfBase.h"
|
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>
|
|
|
|
|
|
|
|
class RigMainGrid;
|
2015-11-27 06:35:17 -06:00
|
|
|
class RigActiveCellInfo;
|
2015-11-16 05:12:42 -06:00
|
|
|
class RigResultAccessor;
|
2016-09-21 03:48:25 -05:00
|
|
|
class RimIntersection;
|
2017-01-17 08:11:02 -06:00
|
|
|
class RivIntersectionHexGridInterface;
|
|
|
|
class RivIntersectionVertexWeights;
|
2015-11-16 03:52:38 -06:00
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class ScalarMapper;
|
|
|
|
class DrawableGeo;
|
|
|
|
}
|
|
|
|
|
2015-11-20 05:02:43 -06:00
|
|
|
|
2016-09-21 03:36:11 -05:00
|
|
|
class RivIntersectionGeometryGenerator : public cvf::Object
|
2015-11-16 03:52:38 -06:00
|
|
|
{
|
|
|
|
public:
|
2017-11-29 07:14:51 -06:00
|
|
|
RivIntersectionGeometryGenerator(RimIntersection* crossSection,
|
2015-11-26 09:00:08 -06:00
|
|
|
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
2015-11-16 03:52:38 -06:00
|
|
|
const cvf::Vec3d& extrusionDirection,
|
2018-01-25 10:37:22 -06:00
|
|
|
const RivIntersectionHexGridInterface* grid,
|
|
|
|
bool isFlattened );
|
2015-11-16 03:52:38 -06:00
|
|
|
|
2016-09-21 03:36:11 -05:00
|
|
|
~RivIntersectionGeometryGenerator();
|
2015-12-03 05:54:13 -06:00
|
|
|
|
|
|
|
bool isAnyGeometryPresent() const;
|
2015-11-20 06:26:41 -06:00
|
|
|
|
|
|
|
// Generate geometry
|
|
|
|
cvf::ref<cvf::DrawableGeo> generateSurface();
|
|
|
|
cvf::ref<cvf::DrawableGeo> createMeshDrawable();
|
2015-11-30 01:10:10 -06:00
|
|
|
cvf::ref<cvf::DrawableGeo> createLineAlongPolylineDrawable();
|
2015-11-30 06:54:56 -06:00
|
|
|
cvf::ref<cvf::DrawableGeo> createPointsFromPolylineDrawable();
|
2015-11-16 03:52:38 -06:00
|
|
|
|
2016-10-18 07:25:31 -05:00
|
|
|
cvf::ref<cvf::DrawableGeo> createLineAlongPolylineDrawable(const std::vector<std::vector<cvf::Vec3d> >& polyLines);
|
|
|
|
cvf::ref<cvf::DrawableGeo> createPointsFromPolylineDrawable(const std::vector<std::vector<cvf::Vec3d> >& polyLines);
|
|
|
|
|
2018-02-07 04:40:48 -06:00
|
|
|
const std::vector<std::vector<cvf::Vec3d> >& flattenedOrOffsettedPolyLines() { return m_flattenedOrOffsettedPolyLines; }
|
2016-10-18 07:25:31 -05:00
|
|
|
|
2015-11-16 03:52:38 -06:00
|
|
|
// Mapping between cells and geometry
|
2016-10-20 09:09:27 -05:00
|
|
|
const std::vector<size_t>& triangleToCellIndex() const;
|
2016-09-21 03:15:38 -05:00
|
|
|
const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const;
|
2016-10-20 09:09:27 -05:00
|
|
|
const cvf::Vec3fArray* triangleVxes() const;
|
2016-10-20 03:49:44 -05:00
|
|
|
|
2017-11-29 07:14:51 -06:00
|
|
|
RimIntersection* crossSection() const;
|
2015-11-26 09:00:08 -06:00
|
|
|
|
2015-11-16 03:52:38 -06:00
|
|
|
private:
|
2015-11-16 05:12:42 -06:00
|
|
|
void calculateArrays();
|
2018-02-05 09:13:07 -06:00
|
|
|
void calculateSegementTransformPrLinePoint();
|
|
|
|
void calculateFlattenedOrOffsetedPolyline();
|
|
|
|
|
|
|
|
static size_t indexToNextValidPoint(const std::vector<cvf::Vec3d>& polyLine,
|
|
|
|
const cvf::Vec3d extrDir,
|
|
|
|
size_t idxToStartOfLineSegment);
|
|
|
|
|
|
|
|
RimIntersection* m_crossSection;
|
|
|
|
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid;
|
|
|
|
const std::vector<std::vector<cvf::Vec3d> > m_polyLines;
|
|
|
|
cvf::Vec3d m_extrusionDirection;
|
|
|
|
bool m_isFlattened;
|
|
|
|
|
|
|
|
// Output arrays
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_cellBorderLineVxes;
|
|
|
|
std::vector<size_t> m_triangleToCellIdxMap;
|
|
|
|
std::vector<RivIntersectionVertexWeights> m_triVxToCellCornerWeights;
|
|
|
|
std::vector<std::vector<cvf::Vec3d> > m_flattenedOrOffsettedPolyLines;
|
|
|
|
std::vector<std::vector<cvf::Mat4d> > m_segementTransformPrLinePoint;
|
|
|
|
|
2015-11-16 03:52:38 -06:00
|
|
|
};
|
|
|
|
|