mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1041 - pre-proto - Adding functions for returning fracture geometry and polygon
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
#include "cafPdmObject.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RigTesselatorTools.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
|
||||
|
||||
@@ -114,6 +116,39 @@ double RimEllipseFractureTemplate::effectiveKh()
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEllipseFractureTemplate::fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices)
|
||||
{
|
||||
RigEllipsisTesselator tesselator(20);
|
||||
|
||||
float a = height / 2.0f;
|
||||
float b = halfLength;
|
||||
|
||||
tesselator.tesselateEllipsis(a, b, polygonIndices, nodeCoords);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3f> RimEllipseFractureTemplate::fracturePolygon()
|
||||
{
|
||||
std::vector<cvf::Vec3f> polygon;
|
||||
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> polygonIndices;
|
||||
|
||||
fractureGeometry(&nodeCoords, &polygonIndices);
|
||||
|
||||
for (size_t i = 1; i < nodeCoords.size(); i++)
|
||||
{
|
||||
polygon.push_back(nodeCoords[i]);
|
||||
}
|
||||
|
||||
return polygon;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user