#1602 Consolidate some intersection functionality to common tools class

This commit is contained in:
Bjørnar Grip Fjær
2017-06-16 09:44:28 +02:00
parent 2e764b3fe5
commit 2090db62b2
9 changed files with 125 additions and 99 deletions

View File

@@ -104,37 +104,6 @@ TEST(RigCellGeometryTools, createPolygonTestRealCase)
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(RigCellGeometryTools, planeHexCellIntersectionTest)
{
cvf::Vec3d hexCorners[8];
hexCorners[0] = cvf::Vec3d(0, 0, 0);
hexCorners[1] = cvf::Vec3d(1, 0, 0);
hexCorners[2] = cvf::Vec3d(0, 1, 0);
hexCorners[3] = cvf::Vec3d(0, 0, 1);
hexCorners[4] = cvf::Vec3d(0, 1, 1);
hexCorners[5] = cvf::Vec3d(1, 1, 0);
hexCorners[6] = cvf::Vec3d(1, 0, 1);
hexCorners[7] = cvf::Vec3d(1, 1, 1);
std::list<std::pair<cvf::Vec3d, cvf::Vec3d > > intersectionLineSegments;
bool isCellIntersected = false;
cvf::Plane fracturePlane;
fracturePlane.setFromPointAndNormal(cvf::Vec3d(0.5, 0.5, 0.5), cvf::Vec3d(1, 0, 0) );
isCellIntersected = RigCellGeometryTools::planeHexCellIntersection(hexCorners, fracturePlane, intersectionLineSegments);
EXPECT_TRUE(isCellIntersected);
fracturePlane.setFromPointAndNormal(cvf::Vec3d(1.5, 1.5, 1.5), cvf::Vec3d(1, 0, 0));
isCellIntersected = RigCellGeometryTools::planeHexCellIntersection(hexCorners, fracturePlane, intersectionLineSegments);
EXPECT_FALSE(isCellIntersected);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------