2018-11-23 06:33:59 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "RivAnnotationsPartMgr.h"
|
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
2018-11-29 03:13:19 -06:00
|
|
|
#include "Rim3dView.h"
|
2018-11-23 06:33:59 -06:00
|
|
|
#include "RimProject.h"
|
|
|
|
|
|
|
|
#include "RivTextAnnotationPartMgr.h"
|
|
|
|
#include "RivReachCircleAnnotationPartMgr.h"
|
|
|
|
#include "RivPolylineAnnotationPartMgr.h"
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RivAnnotationsPartMgr::RivAnnotationsPartMgr(Rim3dView* view)
|
|
|
|
: m_rimView(view)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RivAnnotationsPartMgr::~RivAnnotationsPartMgr()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RivAnnotationsPartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model,
|
|
|
|
const caf::DisplayCoordTransform* displayCoordTransform)
|
|
|
|
{
|
|
|
|
createAnnotationPartManagers();
|
|
|
|
|
|
|
|
for (auto& partMgr : m_textAnnotationPartMgrs)
|
|
|
|
{
|
|
|
|
partMgr->appendDynamicGeometryPartsToModel(model, displayCoordTransform);
|
|
|
|
}
|
|
|
|
for (auto& partMgr : m_reachCircleAnnotationPartMgrs)
|
|
|
|
{
|
|
|
|
partMgr->appendDynamicGeometryPartsToModel(model, displayCoordTransform);
|
|
|
|
}
|
|
|
|
for (auto& partMgr : m_polylineAnnotationPartMgrs)
|
|
|
|
{
|
|
|
|
partMgr->appendDynamicGeometryPartsToModel(model, displayCoordTransform);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RivAnnotationsPartMgr::createAnnotationPartManagers()
|
|
|
|
{
|
|
|
|
RimProject* proj = RiaApplication::instance()->project();
|
|
|
|
auto textAnnotations = proj->textAnnotations();
|
|
|
|
auto reachCircleAnnotations = proj->reachCircleAnnotations();
|
|
|
|
auto polylineAnnotations = proj->polylineAnnotations();
|
|
|
|
|
2018-11-26 04:08:38 -06:00
|
|
|
clearGeometryCache();
|
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
if (m_textAnnotationPartMgrs.size() != textAnnotations.size())
|
|
|
|
{
|
|
|
|
for (auto annotation : textAnnotations)
|
|
|
|
{
|
2018-11-29 03:13:19 -06:00
|
|
|
auto* apm = new RivTextAnnotationPartMgr(m_rimView, annotation);
|
2018-11-23 06:33:59 -06:00
|
|
|
m_textAnnotationPartMgrs.push_back(apm);
|
|
|
|
//m_mapFromViewToIndex[wellPath] = wppm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_reachCircleAnnotationPartMgrs.size() != reachCircleAnnotations.size())
|
|
|
|
{
|
|
|
|
for (auto annotation : reachCircleAnnotations)
|
|
|
|
{
|
2018-11-29 03:13:19 -06:00
|
|
|
auto* apm = new RivReachCircleAnnotationPartMgr(m_rimView, annotation);
|
2018-11-23 06:33:59 -06:00
|
|
|
m_reachCircleAnnotationPartMgrs.push_back(apm);
|
|
|
|
// m_mapFromViewToIndex[wellPath] = wppm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_polylineAnnotationPartMgrs.size() != polylineAnnotations.size())
|
|
|
|
{
|
|
|
|
for (auto annotation : polylineAnnotations)
|
|
|
|
{
|
2018-11-29 03:13:19 -06:00
|
|
|
auto* apm = new RivPolylineAnnotationPartMgr(m_rimView, annotation);
|
2018-11-23 06:33:59 -06:00
|
|
|
m_polylineAnnotationPartMgrs.push_back(apm);
|
|
|
|
// m_mapFromViewToIndex[wellPath] = wppm;
|
|
|
|
}
|
|
|
|
}
|
2018-11-26 07:06:17 -06:00
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RivAnnotationsPartMgr::clearGeometryCache()
|
|
|
|
{
|
|
|
|
m_textAnnotationPartMgrs.clear();
|
|
|
|
m_reachCircleAnnotationPartMgrs.clear();
|
|
|
|
m_polylineAnnotationPartMgrs.clear();
|
|
|
|
}
|