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
|
|
|
|
2016-09-21 00:57:39 -05:00
|
|
|
#include "RivHexGridIntersectionTools.h"
|
|
|
|
|
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;
|
2015-11-26 09:00:08 -06:00
|
|
|
class RimCrossSection;
|
2015-11-16 03:52:38 -06:00
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class ScalarMapper;
|
|
|
|
class DrawableGeo;
|
|
|
|
}
|
|
|
|
|
2015-11-20 05:02:43 -06:00
|
|
|
|
2015-11-16 03:52:38 -06:00
|
|
|
class RivCrossSectionGeometryGenerator : public cvf::Object
|
|
|
|
{
|
|
|
|
public:
|
2015-11-26 09:00:08 -06:00
|
|
|
RivCrossSectionGeometryGenerator(const RimCrossSection* crossSection,
|
|
|
|
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
2015-11-16 03:52:38 -06:00
|
|
|
const cvf::Vec3d& extrusionDirection,
|
2015-11-20 06:26:41 -06:00
|
|
|
const RivCrossSectionHexGridIntf* grid );
|
2015-11-16 03:52:38 -06:00
|
|
|
|
|
|
|
~RivCrossSectionGeometryGenerator();
|
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
|
|
|
|
|
|
|
// Mapping between cells and geometry
|
2015-11-20 06:26:41 -06:00
|
|
|
const std::vector<size_t>& triangleToCellIndex() const;
|
2015-11-20 05:02:43 -06:00
|
|
|
const std::vector<RivVertexWeights>& triangleVxToCellCornerInterpolationWeights() const;
|
2015-11-16 03:52:38 -06:00
|
|
|
|
2015-11-26 09:00:08 -06:00
|
|
|
const RimCrossSection* crossSection() const;
|
|
|
|
|
2015-11-16 03:52:38 -06:00
|
|
|
private:
|
2015-11-16 05:12:42 -06:00
|
|
|
void calculateArrays();
|
2015-11-20 06:26:41 -06:00
|
|
|
static void adjustPolyline(const std::vector<cvf::Vec3d>& polyLine,
|
|
|
|
const cvf::Vec3d extrDir,
|
|
|
|
std::vector<cvf::Vec3d>* adjustedPolyline);
|
2015-11-18 08:29:10 -06:00
|
|
|
|
2015-11-20 06:26:41 -06:00
|
|
|
cvf::cref<RivCrossSectionHexGridIntf> m_hexGrid;
|
2015-11-26 04:08:38 -06:00
|
|
|
const std::vector<std::vector<cvf::Vec3d> > m_polyLines;
|
2015-11-16 05:12:42 -06:00
|
|
|
cvf::Vec3d m_extrusionDirection;
|
2015-11-19 06:33:50 -06:00
|
|
|
|
|
|
|
// Output arrays
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_cellBorderLineVxes;
|
|
|
|
std::vector<size_t> m_triangleToCellIdxMap;
|
2015-11-20 05:02:43 -06:00
|
|
|
std::vector<RivVertexWeights> m_triVxToCellCornerWeights;
|
2015-11-26 09:00:08 -06:00
|
|
|
|
|
|
|
const RimCrossSection* m_crossSection;
|
2015-11-16 03:52:38 -06:00
|
|
|
};
|
|
|
|
|