pre-proto - Fixing include error (and starting method to calculate fracture lenght)

This commit is contained in:
astridkbjorke 2017-01-24 14:25:18 +01:00
parent 08da3e926a
commit 66e2bcd6d8
2 changed files with 31 additions and 3 deletions

View File

@ -21,7 +21,8 @@
#include "cvfStructGrid.h"
#include "cvfGeometryTools.h"
#include "cafHexGridIntersectionTools\cafHexGridIntersectionTools.h"
#include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h"
#include "cvfBoundingBox.h"
//--------------------------------------------------------------------------------------------------
///
@ -179,5 +180,32 @@ void RigCellGeometryTools::findCellLocalXYZ(cvf::Vec3d * hexCorners, cvf::Vec3d
localYdirection = faceCenterCenterVectorJ - crossPoductIZ;
localYdirection.normalize();
//TODO: Check if we end up with 0-vectors, and handle this case...
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCellGeometryTools::polygonAreaWeightedLength(cvf::Vec3d directionOfLength, std::vector<cvf::Vec3d> polygon2d)
{
//TODO: Check that polygon is in xy plane
//Find bounding box
cvf::BoundingBox polygonBBox;
for (cvf::Vec3d nodeCoord : polygon2d) polygonBBox.add(nodeCoord);
cvf::Vec3d bboxCorners[8];
polygonBBox.cornerVertices(bboxCorners);
//Split bounding box in multplie polygons (2D)
int resolutionOfLengthCalc = 20;
//Use clipper to find overlap between bbpolygon and fracture
//Calculate length (max-min) and area
//Calculate area-weighted average of above vectors.
}

View File

@ -38,6 +38,6 @@ public:
static void createPolygonFromLineSegments(std::list<std::pair<cvf::Vec3d, cvf::Vec3d>> &intersectionLineSegments, std::vector<std::vector<cvf::Vec3d>> &polygons);
static void findCellLocalXYZ(cvf::Vec3d * hexCorners, cvf::Vec3d &localXdirection, cvf::Vec3d &localYdirection, cvf::Vec3d &localZdirection);
static void polygonAreaWeightedLength(cvf::Vec3d directionOfLength, std::vector<cvf::Vec3d> polygon2d);
};