mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 17:10:19 -05:00
Optionally show polygon geometry info as text label
This commit is contained in:
1 parent
118ecf941a
commit
e492685070
13 files changed
+241
-120
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include "RiaColorTools.h"
|
||||
|
||||
#include "RigPolyLinesData.h"
|
||||
#include "RigPolygonTools.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimPolygon.h"
|
||||
@@ -65,6 +66,8 @@ RimPolygonInView::RimPolygonInView()
|
||||
CAF_PDM_InitField( &m_selectPolygon, "SelectPolygon", false, "" );
|
||||
caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_selectPolygon );
|
||||
|
||||
CAF_PDM_InitField( &m_showLabel, "ShowLabel", false, "Show Label" );
|
||||
|
||||
CAF_PDM_InitField( &m_handleScalingFactor, "HandleScalingFactor", 2.0, "Handle Scaling Factor" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_targets, "Targets", "Targets" );
|
||||
@@ -305,6 +308,8 @@ void RimPolygonInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
||||
uiOrdering.add( &m_handleScalingFactor );
|
||||
}
|
||||
|
||||
uiOrdering.add( &m_showLabel );
|
||||
|
||||
if ( m_polygon() )
|
||||
{
|
||||
uiOrdering.add( &m_selectPolygon );
|
||||
@@ -388,6 +393,23 @@ void RimPolygonInView::uiOrderingForLocalPolygon( QString uiConfigName, caf::Pdm
|
||||
uiOrdering.add( &m_handleScalingFactor );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimPolygonInView::label() const
|
||||
{
|
||||
if ( m_showLabel() && m_polygon() )
|
||||
{
|
||||
bool includeLastSegmentInfo = false;
|
||||
QString label = m_polygon->name();
|
||||
label += "\n" + RigPolygonTools::geometryDataAsText( m_polygon->pointsInDomainCoords(), includeLastSegmentInfo );
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user