mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3763 Annotations. Define annotation plane Z for global annotations
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RivPolylineAnnotationPartMgr.h"
|
||||
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimPolylinesAnnotation.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RivPolylineGenerator.h"
|
||||
@@ -58,17 +59,22 @@ void RivPolylineAnnotationPartMgr::buildPolylineAnnotationParts(const caf::Displ
|
||||
|
||||
if (!m_rimAnnotation->isEmpty() && m_rimAnnotation->isActive())
|
||||
{
|
||||
const auto& points = m_rimAnnotation->polyLinesData();
|
||||
const auto& pointsInDomain = m_rimAnnotation->polyLinesData();
|
||||
auto lineColor = m_rimAnnotation->appearance()->color();
|
||||
auto isDashedLine = m_rimAnnotation->appearance()->isDashed();
|
||||
auto lineThickness = m_rimAnnotation->appearance()->thickness();
|
||||
|
||||
auto linesInDisplayCoords = points->polyLines();
|
||||
auto linesInDisplayCoords = pointsInDomain->polyLines();
|
||||
auto* collection = dynamic_cast<RimAnnotationCollection*>(annotationCollection());
|
||||
|
||||
for (auto& line : linesInDisplayCoords)
|
||||
{
|
||||
for ( cvf::Vec3d& point : line)
|
||||
{
|
||||
if (collection && collection->snapAnnotations())
|
||||
{
|
||||
point.z() = collection->annotationPlaneZ();
|
||||
}
|
||||
point = displayXf->transformToDisplayCoord(point);
|
||||
}
|
||||
}
|
||||
@@ -101,6 +107,16 @@ void RivPolylineAnnotationPartMgr::clearAllGeometry()
|
||||
m_part = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimAnnotationCollectionBase* RivPolylineAnnotationPartMgr::annotationCollection() const
|
||||
{
|
||||
RimAnnotationCollectionBase* coll;
|
||||
m_rimAnnotation->firstAncestorOrThisOfType(coll);
|
||||
return coll;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user