clang-format: Set column width to 140

* Set column width to 140
* Use c++20
* Remove redundant virtual
This commit is contained in:
Magne Sjaastad
2023-02-26 10:48:40 +01:00
committed by GitHub
parent 8768e186d8
commit f8c5cf389f
1535 changed files with 10456 additions and 19398 deletions

View File

@@ -41,8 +41,7 @@ int RigHexIntersectionTools::lineHexCellIntersection( const cvf::Vec3d
for ( int face = 0; face < 6; ++face )
{
cvf::ubyte faceVertexIndices[4];
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
faceVertexIndices );
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
cvf::Vec3d intersection;
bool isEntering = false;
@@ -64,10 +63,8 @@ int RigHexIntersectionTools::lineHexCellIntersection( const cvf::Vec3d
&isEntering );
if ( intsStatus == 1 )
{
uniqueIntersections.insert( HexIntersectionInfo( intersection,
isEntering,
static_cast<cvf::StructGridInterface::FaceType>( face ),
hexIndex ) );
uniqueIntersections.insert(
HexIntersectionInfo( intersection, isEntering, static_cast<cvf::StructGridInterface::FaceType>( face ), hexIndex ) );
}
}
}
@@ -85,15 +82,12 @@ int RigHexIntersectionTools::lineHexCellIntersection( const cvf::Vec3d
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigHexIntersectionTools::lineIntersectsHexCell( const cvf::Vec3d p1,
const cvf::Vec3d p2,
const cvf::Vec3d hexCorners[8] )
bool RigHexIntersectionTools::lineIntersectsHexCell( const cvf::Vec3d p1, const cvf::Vec3d p2, const cvf::Vec3d hexCorners[8] )
{
for ( int face = 0; face < 6; ++face )
{
cvf::ubyte faceVertexIndices[4];
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
faceVertexIndices );
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
cvf::Vec3d intersection;
bool isEntering = false;
@@ -134,8 +128,7 @@ bool RigHexIntersectionTools::isPointInCell( const cvf::Vec3d point, const cvf::
for ( int face = 0; face < 6; ++face )
{
cvf::ubyte faceVertexIndices[4];
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
faceVertexIndices );
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
cvf::Vec3d faceCenter = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]],
hexCorners[faceVertexIndices[1]],
hexCorners[faceVertexIndices[2]],
@@ -168,8 +161,7 @@ bool RigHexIntersectionTools::planeHexCellIntersection( cvf::Vec3d*
for ( int face = 0; face < 6; ++face )
{
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
faceVertexIndices );
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
cvf::Vec3d faceCenter = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]],
hexCorners[faceVertexIndices[1]],
@@ -180,17 +172,16 @@ bool RigHexIntersectionTools::planeHexCellIntersection( cvf::Vec3d*
{
int next = i < 3 ? i + 1 : 0;
bool isIntersectingPlane =
caf::HexGridIntersectionTools::planeTriangleIntersection( fracturePlane,
hexCorners[faceVertexIndices[i]],
0,
hexCorners[faceVertexIndices[next]],
1,
faceCenter,
2,
&triangleIntersectionPoint1,
&triangleIntersectionPoint2,
&isMostVxesOnPositiveSideOfP1 );
bool isIntersectingPlane = caf::HexGridIntersectionTools::planeTriangleIntersection( fracturePlane,
hexCorners[faceVertexIndices[i]],
0,
hexCorners[faceVertexIndices[next]],
1,
faceCenter,
2,
&triangleIntersectionPoint1,
&triangleIntersectionPoint2,
&isMostVxesOnPositiveSideOfP1 );
if ( isIntersectingPlane )
{
@@ -205,15 +196,14 @@ bool RigHexIntersectionTools::planeHexCellIntersection( cvf::Vec3d*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigHexIntersectionTools::planeHexIntersectionPolygons( std::array<cvf::Vec3d, 8> hexCorners,
cvf::Mat4d transformMatrixForPlane,
bool RigHexIntersectionTools::planeHexIntersectionPolygons( std::array<cvf::Vec3d, 8> hexCorners,
cvf::Mat4d transformMatrixForPlane,
std::vector<std::vector<cvf::Vec3d>>& polygons )
{
bool isCellIntersected = false;
cvf::Plane fracturePlane;
fracturePlane.setFromPointAndNormal( transformMatrixForPlane.translation(),
static_cast<cvf::Vec3d>( transformMatrixForPlane.col( 2 ) ) );
fracturePlane.setFromPointAndNormal( transformMatrixForPlane.translation(), static_cast<cvf::Vec3d>( transformMatrixForPlane.col( 2 ) ) );
// Find line-segments where cell and fracture plane intersects
std::list<std::pair<cvf::Vec3d, cvf::Vec3d>> intersectionLineSegments;
@@ -234,8 +224,7 @@ bool operator<( const HexIntersectionInfo& hi1, const HexIntersectionInfo& hi2 )
if ( hi1.m_hexIndex != hi2.m_hexIndex ) return hi1.m_hexIndex < hi2.m_hexIndex;
if ( hi1.m_face != hi2.m_face ) return hi1.m_face < hi2.m_face;
if ( hi1.m_isIntersectionEntering != hi2.m_isIntersectionEntering )
return hi1.m_isIntersectionEntering < hi2.m_isIntersectionEntering;
if ( hi1.m_isIntersectionEntering != hi2.m_isIntersectionEntering ) return hi1.m_isIntersectionEntering < hi2.m_isIntersectionEntering;
if ( hi1.m_face != hi2.m_face ) return hi1.m_face < hi2.m_face;
if ( cvf::Math::abs( hi2.m_intersectionPoint.x() - hi1.m_intersectionPoint.x() ) > tolerance )