#1041 - pre-proto - Adding functions for returning fracture geometry and polygon

This commit is contained in:
astridkbjorke
2017-01-13 08:58:36 +01:00
parent ba2362ffce
commit ed8d237b7b
2 changed files with 42 additions and 11 deletions

View File

@@ -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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------