mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Bugfix - make show contour label checkbox work for contour plots
This commit is contained in:
committed by
Magne Sjaastad
parent
a630f7710a
commit
6b3b76fc9d
@@ -127,8 +127,12 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
||||
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
|
||||
|
||||
std::vector<std::vector<cvf::BoundingBox>> labelBBoxes;
|
||||
std::vector<cvf::ref<cvf::Drawable>> labelDrawables =
|
||||
createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
||||
std::vector<cvf::ref<cvf::Drawable>> labelDrawables;
|
||||
|
||||
if ( m_contourMapProjection->showContourLabels() )
|
||||
{
|
||||
labelDrawables = createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
||||
}
|
||||
|
||||
std::vector<std::vector<cvf::ref<cvf::Drawable>>> contourDrawablesForAllLevels =
|
||||
createContourPolygons( displayCoordTransform, labelBBoxes );
|
||||
@@ -163,6 +167,9 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_contourMapProjection->showContourLabels() )
|
||||
{
|
||||
for ( auto labelDrawableRef : labelDrawables )
|
||||
{
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
@@ -174,6 +181,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -295,6 +303,8 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
lineBBox.add( displayVertex2 );
|
||||
|
||||
bool addOriginalSegment = true;
|
||||
if ( labelBBoxes.size() > 0 )
|
||||
{
|
||||
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
||||
{
|
||||
if ( lineBBox.intersects( existingBBox ) )
|
||||
@@ -340,6 +350,7 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( addOriginalSegment )
|
||||
{
|
||||
displayLines.push_back( cvf::Vec3f( displayVertex1 ) );
|
||||
|
||||
@@ -239,6 +239,14 @@ bool RimContourMapProjection::showContourLines() const
|
||||
return m_showContourLines();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimContourMapProjection::showContourLabels() const
|
||||
{
|
||||
return m_showContourLabels();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -89,6 +89,7 @@ public:
|
||||
double sampleSpacingFactor() const;
|
||||
void setSampleSpacingFactor( double spacingFactor );
|
||||
bool showContourLines() const;
|
||||
bool showContourLabels() const;
|
||||
|
||||
QString resultAggregationText() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user