#9470 User defined perf length for azimuth fractures

Fractures: Add UI for user-defined perforation length for az fractures
Add user defined perforation length for azimuth fractures.
Janitor: remove duplication
This commit is contained in:
Kristian Bendiksen
2022-11-24 10:42:26 +01:00
committed by GitHub
parent 4345cb3a70
commit e8789f3d4b
14 changed files with 171 additions and 64 deletions

View File

@@ -21,6 +21,7 @@
#include "cafEffectGenerator.h"
#include "cvfArray.h"
#include "cvfDrawableGeo.h"
#include "cvfGeometryTools.h"
#include "cvfPart.h"
#include "cvfPrimitiveSetIndexedUInt.h"
#include "cvfScalarMapper.h"
@@ -122,7 +123,8 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createSurfa
for ( const auto& item : m_completionVizData )
{
auto rotMatrix = rotationMatrixBetweenVectors( cvf::Vec3d::Y_AXIS, item.m_direction );
auto rotMatrix =
cvf::Mat4f( cvf::GeometryTools::rotationMatrixBetweenVectors( cvf::Vec3d::Y_AXIS, item.m_direction ) );
cvf::uint indexOffset = static_cast<cvf::uint>( vertices->size() );
@@ -180,28 +182,6 @@ size_t RivWellConnectionFactorGeometryGenerator::mapFromTriangleToConnectionInde
return connectionIndex;
}
//--------------------------------------------------------------------------------------------------
/// Taken from OverlayNavigationCube::computeNewUpVector
/// Consider move to geometry util class
//--------------------------------------------------------------------------------------------------
cvf::Mat4f RivWellConnectionFactorGeometryGenerator::rotationMatrixBetweenVectors( const cvf::Vec3d& v1,
const cvf::Vec3d& v2 )
{
using namespace cvf;
Vec3d rotAxis = v1 ^ v2;
rotAxis.normalize();
// Guard acos against out-of-domain input
const double dotProduct = Math::clamp( v1 * v2, -1.0, 1.0 );
const double angle = Math::acos( dotProduct );
Mat4d rotMat = Mat4d::fromRotation( rotAxis, angle );
Mat4f myMat( rotMat );
return myMat;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -68,11 +68,10 @@ private:
size_t mapFromTriangleToConnectionIndex( cvf::uint triangleIndex ) const;
cvf::ref<cvf::DrawableGeo> createSurfaceGeometry();
static cvf::Mat4f rotationMatrixBetweenVectors( const cvf::Vec3d& v1, const cvf::Vec3d& v2 );
static void createStarGeometry( std::vector<cvf::Vec3f>* vertices,
std::vector<cvf::uint>* indices,
float radius,
float thickness );
static void createStarGeometry( std::vector<cvf::Vec3f>* vertices,
std::vector<cvf::uint>* indices,
float radius,
float thickness );
static void createSimplifiedStarGeometry( std::vector<cvf::Vec3f>* vertices,
std::vector<cvf::uint>* indices,