mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Grid Box Generator : Improve robustness for invalid bounding box
This commit is contained in:
@@ -69,7 +69,7 @@ void RivGridBoxGenerator::setDisplayModelOffset(cvf::Vec3d offset)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivGridBoxGenerator::setGridBoxDomainCoordBoundingBox(const cvf::BoundingBox& bb)
|
||||
void RivGridBoxGenerator::setGridBoxDomainCoordBoundingBox(const cvf::BoundingBox& incomingBB)
|
||||
{
|
||||
double expandFactor = 0.05;
|
||||
|
||||
@@ -77,6 +77,16 @@ void RivGridBoxGenerator::setGridBoxDomainCoordBoundingBox(const cvf::BoundingBo
|
||||
// Expand the range for ScalarMapperDiscreteLinear until the geometry bounding box has a generated tick mark coords
|
||||
// both below minimum and above maximum bounding box coords
|
||||
|
||||
cvf::BoundingBox bb;
|
||||
if (incomingBB.isValid())
|
||||
{
|
||||
bb = incomingBB;
|
||||
}
|
||||
else
|
||||
{
|
||||
bb.add(cvf::Vec3d::ZERO);
|
||||
}
|
||||
|
||||
cvf::Vec3d min = bb.min();
|
||||
cvf::Vec3d max = bb.max();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user