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
db007dfaab
commit
784e241eb9
@@ -127,8 +127,12 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
|||||||
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
|
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
|
||||||
|
|
||||||
std::vector<std::vector<cvf::BoundingBox>> labelBBoxes;
|
std::vector<std::vector<cvf::BoundingBox>> labelBBoxes;
|
||||||
std::vector<cvf::ref<cvf::Drawable>> labelDrawables =
|
std::vector<cvf::ref<cvf::Drawable>> labelDrawables;
|
||||||
createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
|
||||||
|
if ( m_contourMapProjection->showContourLabels() )
|
||||||
|
{
|
||||||
|
labelDrawables = createContourLabels( camera, displayCoordTransform, &labelBBoxes );
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::vector<cvf::ref<cvf::Drawable>>> contourDrawablesForAllLevels =
|
std::vector<std::vector<cvf::ref<cvf::Drawable>>> contourDrawablesForAllLevels =
|
||||||
createContourPolygons( displayCoordTransform, labelBBoxes );
|
createContourPolygons( displayCoordTransform, labelBBoxes );
|
||||||
@@ -163,6 +167,9 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_contourMapProjection->showContourLabels() )
|
||||||
|
{
|
||||||
for ( auto labelDrawableRef : labelDrawables )
|
for ( auto labelDrawableRef : labelDrawables )
|
||||||
{
|
{
|
||||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||||
@@ -173,6 +180,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
|||||||
model->addPart( part.p() );
|
model->addPart( part.p() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -295,6 +303,8 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
|||||||
lineBBox.add( displayVertex2 );
|
lineBBox.add( displayVertex2 );
|
||||||
|
|
||||||
bool addOriginalSegment = true;
|
bool addOriginalSegment = true;
|
||||||
|
if ( labelBBoxes.size() > 0 )
|
||||||
|
{
|
||||||
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
||||||
{
|
{
|
||||||
if ( lineBBox.intersects( existingBBox ) )
|
if ( lineBBox.intersects( existingBBox ) )
|
||||||
@@ -340,6 +350,7 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( addOriginalSegment )
|
if ( addOriginalSegment )
|
||||||
{
|
{
|
||||||
displayLines.push_back( cvf::Vec3f( displayVertex1 ) );
|
displayLines.push_back( cvf::Vec3f( displayVertex1 ) );
|
||||||
|
|||||||
@@ -239,6 +239,14 @@ bool RimContourMapProjection::showContourLines() const
|
|||||||
return m_showContourLines();
|
return m_showContourLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimContourMapProjection::showContourLabels() const
|
||||||
|
{
|
||||||
|
return m_showContourLabels();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public:
|
|||||||
double sampleSpacingFactor() const;
|
double sampleSpacingFactor() const;
|
||||||
void setSampleSpacingFactor( double spacingFactor );
|
void setSampleSpacingFactor( double spacingFactor );
|
||||||
bool showContourLines() const;
|
bool showContourLines() const;
|
||||||
|
bool showContourLabels() const;
|
||||||
|
|
||||||
QString resultAggregationText() const;
|
QString resultAggregationText() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user