2016-09-21 00:57:39 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-09-21 00:57:39 -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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-09-21 00:57:39 -05: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>
|
2016-09-21 00:57:39 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-10-15 09:57:18 -05:00
|
|
|
#include "RivIntersectionGeometryGeneratorInterface.h"
|
2016-09-21 01:50:55 -05:00
|
|
|
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
|
|
|
#include "cvfArray.h"
|
2019-09-05 02:43:17 -05:00
|
|
|
|
2016-09-21 01:50:55 -05:00
|
|
|
#include "cvfObject.h"
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2019-11-26 06:14:55 -06:00
|
|
|
class RimBoxIntersection;
|
2021-10-15 09:57:18 -05:00
|
|
|
class RivIntersectionHexGridInterface;
|
2016-09-21 01:50:55 -05:00
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
class ScalarMapper;
|
|
|
|
class DrawableGeo;
|
|
|
|
} // namespace cvf
|
2016-09-21 01:50:55 -05:00
|
|
|
|
2021-10-15 09:57:18 -05:00
|
|
|
class RivBoxIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface
|
2016-09-21 01:50:55 -05:00
|
|
|
{
|
|
|
|
public:
|
2020-02-12 04:43:15 -06:00
|
|
|
RivBoxIntersectionGeometryGenerator( RimBoxIntersection* intersectionBox, const RivIntersectionHexGridInterface* grid );
|
2016-09-21 01:50:55 -05:00
|
|
|
|
2019-11-26 06:20:16 -06:00
|
|
|
~RivBoxIntersectionGeometryGenerator() override;
|
2016-09-21 01:50:55 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
// Generate geometry
|
2023-06-05 00:33:04 -05:00
|
|
|
cvf::ref<cvf::DrawableGeo> generateSurface( cvf::UByteArray* visibleCells );
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<cvf::DrawableGeo> createMeshDrawable();
|
2016-09-21 01:50:55 -05:00
|
|
|
|
2019-11-26 06:14:55 -06:00
|
|
|
RimBoxIntersection* intersectionBox() const;
|
2016-09-21 01:50:55 -05:00
|
|
|
|
2019-11-20 06:59:16 -06:00
|
|
|
// GeomGen Interface
|
|
|
|
|
|
|
|
bool isAnyGeometryPresent() const override;
|
|
|
|
|
|
|
|
const std::vector<size_t>& triangleToCellIndex() const override;
|
|
|
|
const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const override;
|
|
|
|
const cvf::Vec3fArray* triangleVxes() const override;
|
|
|
|
|
2016-09-21 01:50:55 -05:00
|
|
|
private:
|
2023-06-05 00:33:04 -05:00
|
|
|
void calculateArrays( cvf::UByteArray* visibleCells );
|
2016-09-21 01:50:55 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid;
|
2016-09-21 01:50:55 -05:00
|
|
|
|
|
|
|
// Output arrays
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
|
|
|
cvf::ref<cvf::Vec3fArray> m_cellBorderLineVxes;
|
|
|
|
std::vector<size_t> m_triangleToCellIdxMap;
|
|
|
|
std::vector<RivIntersectionVertexWeights> m_triVxToCellCornerWeights;
|
2016-09-21 01:50:55 -05:00
|
|
|
|
2019-11-26 06:14:55 -06:00
|
|
|
RimBoxIntersection* m_intersectionBoxDefinition;
|
2016-09-21 01:50:55 -05:00
|
|
|
};
|