mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3758 Annotations. Add appearance settings to line based annotations
This commit is contained in:
@@ -52,13 +52,16 @@ RivPolylineAnnotationPartMgr::~RivPolylineAnnotationPartMgr()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivPolylineAnnotationPartMgr::buildPolygonAnnotationParts(const caf::DisplayCoordTransform* displayXf)
|
||||
void RivPolylineAnnotationPartMgr::buildPolylineAnnotationParts(const caf::DisplayCoordTransform* displayXf)
|
||||
{
|
||||
clearAllGeometry();
|
||||
|
||||
if (!m_rimAnnotation->isEmpty())
|
||||
{
|
||||
const auto& points = 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();
|
||||
|
||||
@@ -75,8 +78,10 @@ void RivPolylineAnnotationPartMgr::buildPolygonAnnotationParts(const caf::Displa
|
||||
//part->setName("RivAnnotationPartMgr: text " + cvfString);
|
||||
part->setDrawable(drawableGeo.p());
|
||||
|
||||
caf::MeshEffectGenerator colorEffgen(cvf::Color3f::RED);
|
||||
cvf::ref<cvf::Effect> eff = colorEffgen.generateCachedEffect();
|
||||
caf::MeshEffectGenerator effgen(lineColor);
|
||||
effgen.setLineWidth(lineThickness);
|
||||
if (isDashedLine) effgen.setLineStipple(true);
|
||||
cvf::ref<cvf::Effect> eff = effgen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
part->setPriority(RivPartPriority::PartType::MeshLines);
|
||||
@@ -105,7 +110,7 @@ void RivPolylineAnnotationPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelB
|
||||
if (m_rimAnnotation.isNull()) return;
|
||||
if (m_rimAnnotation->isEmpty()) return;
|
||||
|
||||
buildPolygonAnnotationParts(displayXf);
|
||||
buildPolylineAnnotationParts(displayXf);
|
||||
model->addPart(m_part.p());
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
const caf::DisplayCoordTransform * displayXf);
|
||||
|
||||
private:
|
||||
void buildPolygonAnnotationParts(const caf::DisplayCoordTransform* displayXf);
|
||||
void buildPolylineAnnotationParts(const caf::DisplayCoordTransform* displayXf);
|
||||
|
||||
void clearAllGeometry();
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@ void RivReachCircleAnnotationPartMgr::buildParts(const caf::DisplayCoordTransfor
|
||||
|
||||
Vec3d centerPosition = displayXf->transformToDisplayCoord(m_rimAnnotation->centerPoint());
|
||||
double radius = m_rimAnnotation->radius();
|
||||
auto lineColor = m_rimAnnotation->appearance()->color();
|
||||
auto isDashedLine = m_rimAnnotation->appearance()->isDashed();
|
||||
auto lineThickness = m_rimAnnotation->appearance()->thickness();
|
||||
|
||||
// Circle part
|
||||
{
|
||||
@@ -82,8 +85,10 @@ void RivReachCircleAnnotationPartMgr::buildParts(const caf::DisplayCoordTransfor
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable(drawableGeo.p());
|
||||
|
||||
caf::MeshEffectGenerator colorEffgen(cvf::Color3f::RED);
|
||||
cvf::ref<cvf::Effect> eff = colorEffgen.generateUnCachedEffect();
|
||||
caf::MeshEffectGenerator effgen(lineColor);
|
||||
effgen.setLineWidth(lineThickness);
|
||||
if (isDashedLine) effgen.setLineStipple(true);
|
||||
cvf::ref<cvf::Effect> eff = effgen.generateUnCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
part->setPriority(RivPartPriority::PartType::MeshLines);
|
||||
|
||||
Reference in New Issue
Block a user