#2175 Intersection: Set length in two directions

This commit is contained in:
Unknown
2017-11-24 13:57:35 +01:00
committed by Rebecca Cox
parent ea74a77978
commit e765a9ad59
4 changed files with 65 additions and 22 deletions

View File

@@ -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);