mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2175 Intersection: Set length in two directions
This commit is contained in:
parent
ea74a77978
commit
e765a9ad59
@ -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);
|
||||
|
@ -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<size_t> columnCellCandidates;
|
||||
m_hexGrid->findIntersectingCells(sectionBBox, &columnCellCandidates);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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<double> m_extentLength;
|
||||
caf::PdmField<double> m_azimuthAngle;
|
||||
caf::PdmField<double> m_dipAngle;
|
||||
caf::PdmField<double> m_height;
|
||||
caf::PdmField<double> m_lengthUp;
|
||||
caf::PdmField<double> m_lengthDown;
|
||||
|
||||
caf::PdmField< std::vector< cvf::Vec3d> > m_userPolyline;
|
||||
caf::PdmField< std::vector< cvf::Vec3d> > m_customExtrusionPoints;
|
||||
|
Loading…
Reference in New Issue
Block a user