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

View File

@ -23,6 +23,11 @@
#include "cafPdmFieldHandle.h"
#include "cafPdmObject.h"
#include "cvfBase.h"
#include "cvfVector3.h"
#include <vector>
//==================================================================================================
///
@ -58,17 +63,8 @@ public:
double effectiveKh();
//TODO: Method to get 2D geometry. Returning indexed triangles
//Code from RimFracture::ComputeGeometry
//TODO: Method to return a polygon from indexed triangles.
//clipper execute method, union for general case.
//FOr now: void RigEllipsisTesselator::computeCirclePoints(size_t numSlices) og gi ut rekke med punkter...
//Return punkter std::vector<cvf::Vec3d>
void fractureGeometry(std::vector<cvf::Vec3f>* nodeCoords, std::vector<cvf::uint>* polygonIndices);
std::vector<cvf::Vec3f> fracturePolygon();
protected: