diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp index b47a27d309..049500112a 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp @@ -118,7 +118,8 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo() cvf::BoundingBox bBox = rimCase->allCellsBoundingBox(); if (bBox.isValid()) { - intersection->setHeight(cvf::Math::floor(bBox.extent()[2])); + intersection->setLengthUp(cvf::Math::floor(bBox.extent()[2] / 2)); + intersection->setLengthDown(cvf::Math::floor(bBox.extent()[2] / 2)); } m_intersectionCollection->appendIntersection(intersection); diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp index fb2cdc9ae1..fbab9f44a4 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp @@ -92,24 +92,44 @@ void RivIntersectionGeometryGenerator::calculateArrays() sectionBBox.add(p1); sectionBBox.add(p2); - double maxSectionHeight; + + cvf::Vec3d maxHeightVec; + + double maxSectionHeight = sectionBBox.radius(); + double maxSectionHeightUp; + double maxSectionHeightDown; + if (m_crossSection->type == RimIntersection::CS_AZIMUTHLINE) { - maxSectionHeight = m_crossSection->height(); + maxSectionHeightUp = m_crossSection->lengthUp(); + maxSectionHeightDown = m_crossSection->lengthDown(); + + if (maxSectionHeightUp + maxSectionHeightDown == 0) + { + return; + } + + cvf::Vec3d maxHeightVecDown = m_extrusionDirection*maxSectionHeightUp; + cvf::Vec3d maxHeightVecUp = m_extrusionDirection*maxSectionHeightDown; + + sectionBBox.add(p1 + maxHeightVecUp); + sectionBBox.add(p1 - maxHeightVecDown); + sectionBBox.add(p2 + maxHeightVecUp); + sectionBBox.add(p2 - maxHeightVecDown); + + maxHeightVec = maxHeightVecUp + maxHeightVecDown; } else { - maxSectionHeight = sectionBBox.radius(); + maxHeightVec = m_extrusionDirection*maxSectionHeight; + + sectionBBox.add(p1 + maxHeightVec); + sectionBBox.add(p1 - maxHeightVec); + sectionBBox.add(p2 + maxHeightVec); + sectionBBox.add(p2 - maxHeightVec); + } - if (maxSectionHeight == 0) return; - - cvf::Vec3d maxHeightVec = m_extrusionDirection*maxSectionHeight; - - sectionBBox.add(p1 + maxHeightVec); - sectionBBox.add(p1 - maxHeightVec); - sectionBBox.add(p2 + maxHeightVec); - sectionBBox.add(p2 - maxHeightVec); std::vector columnCellCandidates; m_hexGrid->findIntersectingCells(sectionBBox, &columnCellCandidates); diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.cpp b/ApplicationCode/ProjectDataModel/RimIntersection.cpp index 3db54db277..72c4e24a16 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersection.cpp @@ -102,7 +102,8 @@ RimIntersection::RimIntersection() CAF_PDM_InitField (&m_branchIndex, "Branch", -1, "Branch", "", "", ""); CAF_PDM_InitField (&m_extentLength, "ExtentLength", 200.0, "Extent Length", "", "", ""); - CAF_PDM_InitField (&m_height, "Height", 2000.0, "Height", "", "", ""); + CAF_PDM_InitField (&m_lengthUp, "lengthUp", 1000.0, "Length Up", "", "", ""); + CAF_PDM_InitField (&m_lengthDown, "lengthDown", 1000.0, "Length Down", "", "", ""); CAF_PDM_InitField (&showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", ""); @@ -141,7 +142,8 @@ void RimIntersection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, changedField == &simulationWell || changedField == &m_branchIndex || changedField == &m_extentLength || - changedField == &m_height || + changedField == &m_lengthUp || + changedField == &m_lengthDown || changedField == &showInactiveCells) { rebuildGeometryAndScheduleCreateDisplayModel(); @@ -250,7 +252,8 @@ void RimIntersection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& if (type == CS_AZIMUTHLINE) { - optionsGroup->add(&m_height); + optionsGroup->add(&m_lengthUp); + optionsGroup->add(&m_lengthDown); } else { @@ -793,17 +796,33 @@ cvf::Vec3d RimIntersection::extrusionDirection() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RimIntersection::height() const +double RimIntersection::lengthUp() const { - return m_height; + return m_lengthUp; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimIntersection::setHeight(double height) +double RimIntersection::lengthDown() const { - m_height = height; + return m_lengthDown; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimIntersection::setLengthDown(double lengthDown) +{ + m_lengthDown = lengthDown; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimIntersection::setLengthUp(double lengthUp) +{ + m_lengthUp = lengthUp; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.h b/ApplicationCode/ProjectDataModel/RimIntersection.h index 16577aba7e..9de727ec40 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.h +++ b/ApplicationCode/ProjectDataModel/RimIntersection.h @@ -94,8 +94,10 @@ public: void appendPointToAzimuthLine(const cvf::Vec3d& point); cvf::Vec3d extrusionDirection() const; - double height() const; - void setHeight(double height); + double lengthUp() const; + double lengthDown() const; + void setLengthUp(double heightUp); + void setLengthDown(double heightDown); protected: virtual caf::PdmFieldHandle* userDescriptionField(); @@ -114,7 +116,8 @@ private: caf::PdmField m_extentLength; caf::PdmField m_azimuthAngle; caf::PdmField m_dipAngle; - caf::PdmField m_height; + caf::PdmField m_lengthUp; + caf::PdmField m_lengthDown; caf::PdmField< std::vector< cvf::Vec3d> > m_userPolyline; caf::PdmField< std::vector< cvf::Vec3d> > m_customExtrusionPoints;