mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Intersection : Add Python support for triangle and result values (#8505)
#8508 Python : Make sure an empty list will be received as empty list in Python Co-authored-by: magnesj <magnesj@users.noreply.github.com>
This commit is contained in:
@@ -478,6 +478,15 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
point1 = point1.getTransformedPoint( invSectionCS );
|
||||
point2 = point2.getTransformedPoint( invSectionCS );
|
||||
|
||||
if ( m_isFlattened )
|
||||
{
|
||||
// The points are transformed in to the XZ-plane with Y = zero.
|
||||
// Set all y values to zero to avoid numerical issues
|
||||
point0.y() = 0.0;
|
||||
point1.y() = 0.0;
|
||||
point2.y() = 0.0;
|
||||
}
|
||||
|
||||
triangleVertices.emplace_back( point0 );
|
||||
triangleVertices.emplace_back( point1 );
|
||||
triangleVertices.emplace_back( point2 );
|
||||
@@ -765,6 +774,31 @@ const cvf::Vec3fArray* RivExtrudedCurveIntersectionGeometryGenerator::triangleVx
|
||||
return m_triangleVxes.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const cvf::Vec3fArray* RivExtrudedCurveIntersectionGeometryGenerator::cellMeshVxes() const
|
||||
{
|
||||
CVF_ASSERT( m_cellBorderLineVxes->size() );
|
||||
return m_cellBorderLineVxes.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const cvf::Vec3fArray* RivExtrudedCurveIntersectionGeometryGenerator::faultMeshVxes() const
|
||||
{
|
||||
return m_faultCellBorderLineVxes.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionGeometryGenerator::ensureGeometryIsCalculated()
|
||||
{
|
||||
calculateArrays();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -81,6 +81,10 @@ public:
|
||||
const std::vector<size_t>& triangleToCellIndex() const override;
|
||||
const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const override;
|
||||
const cvf::Vec3fArray* triangleVxes() const override;
|
||||
const cvf::Vec3fArray* cellMeshVxes() const override;
|
||||
const cvf::Vec3fArray* faultMeshVxes() const override;
|
||||
|
||||
void ensureGeometryIsCalculated();
|
||||
|
||||
private:
|
||||
void calculateArrays();
|
||||
|
@@ -27,8 +27,11 @@
|
||||
class RivIntersectionGeometryGeneratorInterface
|
||||
{
|
||||
public:
|
||||
virtual bool isAnyGeometryPresent() const = 0;
|
||||
virtual const std::vector<size_t>& triangleToCellIndex() const = 0;
|
||||
virtual ~RivIntersectionGeometryGeneratorInterface() = default;
|
||||
virtual bool isAnyGeometryPresent() const = 0;
|
||||
virtual const std::vector<size_t>& triangleToCellIndex() const = 0;
|
||||
virtual const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const = 0;
|
||||
virtual const cvf::Vec3fArray* triangleVxes() const = 0;
|
||||
virtual const cvf::Vec3fArray* cellMeshVxes() const { return nullptr; };
|
||||
virtual const cvf::Vec3fArray* faultMeshVxes() const { return nullptr; };
|
||||
};
|
||||
|
Reference in New Issue
Block a user