Intersection : Add Python support for triangle and result values (#8505)

Co-authored-by: magnesj <magnesj@users.noreply.github.com>
This commit is contained in:
Magne Sjaastadandmagnesj committed 2022-04-04 12:06:01 +02:00
1 parent 7c4e81f59f
commit cf45f78aa3
18 files changed
+722 -27

No files matched your search

@@ -438,6 +438,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 );
@@ -643,6 +652,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; };
};