mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-05 21:53:27 -06:00
#3756 Annotations. Moved files to subdirs
This commit is contained in:
parent
cdaa5e2af6
commit
e578deb43c
@ -37,6 +37,7 @@ include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CommandFileInterface/Core
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Annotations
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Completions
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Flow
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Summary
|
||||
@ -90,6 +91,7 @@ list( APPEND REFERENCED_CMAKE_FILES
|
||||
ProjectDataModel/CMakeLists_files.cmake
|
||||
ProjectDataModel/Summary/CMakeLists_files.cmake
|
||||
ProjectDataModel/Flow/CMakeLists_files.cmake
|
||||
ProjectDataModel/Annotations/CMakeLists_files.cmake
|
||||
ProjectDataModel/Completions/CMakeLists_files.cmake
|
||||
|
||||
GeoMech/GeoMechVisualization/CMakeLists_files.cmake
|
||||
|
@ -1,12 +1,16 @@
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.h
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.cpp
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// 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 "RicCreateUserDefinedPolylinesAnnotationFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimTextAnnotation.h"
|
||||
#include "RimReachCircleAnnotation.h"
|
||||
#include "RimPolylinesAnnotation.h"
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimOilField.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include <cafSelectionManagerTools.h>
|
||||
|
||||
#include <QAction>
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicCreateUserDefinedPolylinesAnnotationFeature, "RicCreateUserDefinedPolylinesAnnotationFeature");
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicCreateUserDefinedPolylinesAnnotationFeature::isCommandEnabled()
|
||||
{
|
||||
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
|
||||
return selObjs.size() == 1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateUserDefinedPolylinesAnnotationFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
auto coll = annotationCollection();
|
||||
if (coll)
|
||||
{
|
||||
auto newAnnotation = new RimUserDefinedPolylinesAnnotation();
|
||||
coll->addAnnotation(newAnnotation);
|
||||
coll->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateUserDefinedPolylinesAnnotationFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/Plus.png"));
|
||||
actionToSetup->setText("Create User Defined Polyline Annotation");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimAnnotationCollection* RicCreateUserDefinedPolylinesAnnotationFeature::annotationCollection() const
|
||||
{
|
||||
auto project = RiaApplication::instance()->project();
|
||||
auto oilField = project->activeOilField();
|
||||
return oilField ? oilField->annotationCollection() : nullptr;
|
||||
}
|
@ -71,7 +71,7 @@ void RicImportPolylinesAnnotationFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
// For each file,
|
||||
|
||||
RimPolyLinesFromFileAnnotation* lastCreatedOrUpdated = annotColl->importOrUpdatePolylinesFromFile(fileNames);
|
||||
RimPolylinesFromFileAnnotation* lastCreatedOrUpdated = annotColl->importOrUpdatePolylinesFromFile(fileNames);
|
||||
|
||||
proj->updateConnectedEditors();
|
||||
|
||||
|
@ -76,9 +76,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.h
|
||||
)
|
||||
|
||||
|
||||
@ -153,9 +150,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.cpp
|
||||
)
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ void RicCreateUserDefinedPolylinesAnnotationFeature::onActionTriggered(bool isCh
|
||||
auto coll = annotationCollection();
|
||||
if (coll)
|
||||
{
|
||||
auto newAnnotation = new RimUserDefinedPolyLinesAnnotation();
|
||||
auto newAnnotation = new RimUserDefinedPolylinesAnnotation();
|
||||
coll->addAnnotation(newAnnotation);
|
||||
coll->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
|
||||
|
@ -0,0 +1,31 @@
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
${SOURCE_GROUP_HEADER_FILES}
|
||||
)
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES
|
||||
${SOURCE_GROUP_SOURCE_FILES}
|
||||
)
|
||||
|
||||
set (QT_MOC_HEADERS
|
||||
${QT_MOC_HEADERS}
|
||||
)
|
||||
|
||||
|
||||
source_group( "ProjectDataModel\\Annotations" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake )
|
@ -110,7 +110,7 @@ std::vector<RimPolylinesAnnotation*> RimAnnotationCollection::polylineAnnotation
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPolyLinesFromFileAnnotation*> RimAnnotationCollection::polylinesFromFileAnnotations() const
|
||||
std::vector<RimPolylinesFromFileAnnotation*> RimAnnotationCollection::polylinesFromFileAnnotations() const
|
||||
{
|
||||
return m_polylineFromFileAnnotations.childObjects();
|
||||
}
|
||||
@ -118,16 +118,16 @@ std::vector<RimPolyLinesFromFileAnnotation*> RimAnnotationCollection::polylinesF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPolyLinesFromFileAnnotation* RimAnnotationCollection::importOrUpdatePolylinesFromFile(const QStringList& fileNames)
|
||||
RimPolylinesFromFileAnnotation* RimAnnotationCollection::importOrUpdatePolylinesFromFile(const QStringList& fileNames)
|
||||
{
|
||||
QStringList newFileNames;
|
||||
std::vector<RimPolyLinesFromFileAnnotation*> polyLinesObjsToReload;
|
||||
std::vector<RimPolylinesFromFileAnnotation*> polyLinesObjsToReload;
|
||||
size_t formationListBeforeImportCount = m_polylineFromFileAnnotations.size();
|
||||
|
||||
for(const QString& newFileName : fileNames)
|
||||
{
|
||||
bool isFound = false;
|
||||
for(RimPolyLinesFromFileAnnotation* polyLinesAnnot: m_polylineFromFileAnnotations)
|
||||
for(RimPolylinesFromFileAnnotation* polyLinesAnnot: m_polylineFromFileAnnotations)
|
||||
{
|
||||
if(polyLinesAnnot->fileName() == newFileName)
|
||||
{
|
||||
@ -145,7 +145,7 @@ RimPolyLinesFromFileAnnotation* RimAnnotationCollection::importOrUpdatePolylines
|
||||
|
||||
for(const QString& newFileName : newFileNames)
|
||||
{
|
||||
RimPolyLinesFromFileAnnotation* newPolyLinesAnnot = new RimPolyLinesFromFileAnnotation;
|
||||
RimPolylinesFromFileAnnotation* newPolyLinesAnnot = new RimPolylinesFromFileAnnotation;
|
||||
newPolyLinesAnnot->setFileName(newFileName);
|
||||
m_polylineFromFileAnnotations.push_back(newPolyLinesAnnot);
|
||||
polyLinesObjsToReload.push_back(newPolyLinesAnnot);
|
||||
@ -154,7 +154,7 @@ RimPolyLinesFromFileAnnotation* RimAnnotationCollection::importOrUpdatePolylines
|
||||
|
||||
QString totalErrorMessage;
|
||||
|
||||
for (RimPolyLinesFromFileAnnotation* polyLinesAnnot: polyLinesObjsToReload)
|
||||
for (RimPolylinesFromFileAnnotation* polyLinesAnnot: polyLinesObjsToReload)
|
||||
{
|
||||
QString errormessage;
|
||||
|
@ -29,7 +29,7 @@ class QString;
|
||||
class RimTextAnnotation;
|
||||
class RimReachCircleAnnotation;
|
||||
class RimPolylinesAnnotation;
|
||||
class RimPolyLinesFromFileAnnotation;
|
||||
class RimPolylinesFromFileAnnotation;
|
||||
class RimGridView;
|
||||
|
||||
//==================================================================================================
|
||||
@ -50,9 +50,9 @@ public:
|
||||
std::vector<RimTextAnnotation*> textAnnotations() const;
|
||||
std::vector<RimReachCircleAnnotation*> reachCircleAnnotations() const;
|
||||
std::vector<RimPolylinesAnnotation*> polylineAnnotations() const;
|
||||
std::vector<RimPolyLinesFromFileAnnotation*> polylinesFromFileAnnotations() const;
|
||||
std::vector<RimPolylinesFromFileAnnotation*> polylinesFromFileAnnotations() const;
|
||||
|
||||
RimPolyLinesFromFileAnnotation* importOrUpdatePolylinesFromFile(const QStringList& fileNames );
|
||||
RimPolylinesFromFileAnnotation* importOrUpdatePolylinesFromFile(const QStringList& fileNames );
|
||||
void scheduleRedrawOfRelevantViews();
|
||||
std::vector<RimGridView*> gridViewsContainingAnnotations() const;
|
||||
|
||||
@ -60,5 +60,5 @@ private:
|
||||
caf::PdmChildArrayField<RimTextAnnotation*> m_textAnnotations;
|
||||
caf::PdmChildArrayField<RimReachCircleAnnotation*> m_reachCircleAnnotations;
|
||||
caf::PdmChildArrayField<RimPolylinesAnnotation*> m_polylineAnnotations;
|
||||
caf::PdmChildArrayField<RimPolyLinesFromFileAnnotation*> m_polylineFromFileAnnotations;
|
||||
caf::PdmChildArrayField<RimPolylinesFromFileAnnotation*> m_polylineFromFileAnnotations;
|
||||
};
|
@ -57,12 +57,12 @@ caf::PdmFieldHandle* RimPolylinesAnnotation::objectToggleField()
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimUserDefinedPolyLinesAnnotation, "UserDefinedPolyLinesAnnotation");
|
||||
CAF_PDM_SOURCE_INIT(RimUserDefinedPolylinesAnnotation, "UserDefinedPolylinesAnnotation");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimUserDefinedPolyLinesAnnotation::RimUserDefinedPolyLinesAnnotation()
|
||||
RimUserDefinedPolylinesAnnotation::RimUserDefinedPolylinesAnnotation()
|
||||
{
|
||||
CAF_PDM_InitObject("PolyLines Annotation", ":/WellCollection.png", "", "");
|
||||
|
||||
@ -72,7 +72,7 @@ RimUserDefinedPolyLinesAnnotation::RimUserDefinedPolyLinesAnnotation()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimUserDefinedPolyLinesAnnotation::~RimUserDefinedPolyLinesAnnotation()
|
||||
RimUserDefinedPolylinesAnnotation::~RimUserDefinedPolylinesAnnotation()
|
||||
{
|
||||
|
||||
}
|
||||
@ -80,7 +80,7 @@ RimUserDefinedPolyLinesAnnotation::~RimUserDefinedPolyLinesAnnotation()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigPolyLinesData> RimUserDefinedPolyLinesAnnotation::polyLinesData()
|
||||
cvf::ref<RigPolyLinesData> RimUserDefinedPolylinesAnnotation::polyLinesData()
|
||||
{
|
||||
cvf::ref<RigPolyLinesData> pld = new RigPolyLinesData;
|
||||
std::vector<std::vector<cvf::Vec3d> > lines;
|
||||
@ -93,7 +93,7 @@ cvf::ref<RigPolyLinesData> RimUserDefinedPolyLinesAnnotation::polyLinesData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimUserDefinedPolyLinesAnnotation::isEmpty()
|
||||
bool RimUserDefinedPolylinesAnnotation::isEmpty()
|
||||
{
|
||||
return m_points().empty();
|
||||
}
|
||||
@ -101,7 +101,7 @@ bool RimUserDefinedPolyLinesAnnotation::isEmpty()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimUserDefinedPolyLinesAnnotation::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
void RimUserDefinedPolylinesAnnotation::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_points);
|
||||
|
||||
@ -111,7 +111,7 @@ void RimUserDefinedPolyLinesAnnotation::defineUiOrdering(QString uiConfigName, c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimUserDefinedPolyLinesAnnotation::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
void RimUserDefinedPolylinesAnnotation::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
@ -126,12 +126,12 @@ void RimUserDefinedPolyLinesAnnotation::fieldChangedByUi(const caf::PdmFieldHand
|
||||
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimPolyLinesFromFileAnnotation, "PolyLinesFromFileAnnotation");
|
||||
CAF_PDM_SOURCE_INIT(RimPolylinesFromFileAnnotation, "PolylinesFromFileAnnotation");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPolyLinesFromFileAnnotation::RimPolyLinesFromFileAnnotation()
|
||||
RimPolylinesFromFileAnnotation::RimPolylinesFromFileAnnotation()
|
||||
{
|
||||
CAF_PDM_InitObject("PolyLines Annotation", ":/WellCollection.png", "", "");
|
||||
|
||||
@ -144,7 +144,7 @@ RimPolyLinesFromFileAnnotation::RimPolyLinesFromFileAnnotation()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPolyLinesFromFileAnnotation::~RimPolyLinesFromFileAnnotation()
|
||||
RimPolylinesFromFileAnnotation::~RimPolylinesFromFileAnnotation()
|
||||
{
|
||||
|
||||
}
|
||||
@ -152,7 +152,7 @@ RimPolyLinesFromFileAnnotation::~RimPolyLinesFromFileAnnotation()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolyLinesFromFileAnnotation::setFileName(const QString& fileName)
|
||||
void RimPolylinesFromFileAnnotation::setFileName(const QString& fileName)
|
||||
{
|
||||
m_polyLinesFileName = fileName;
|
||||
}
|
||||
@ -160,7 +160,7 @@ void RimPolyLinesFromFileAnnotation::setFileName(const QString& fileName)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString& RimPolyLinesFromFileAnnotation::fileName()
|
||||
const QString& RimPolylinesFromFileAnnotation::fileName()
|
||||
{
|
||||
return m_polyLinesFileName();
|
||||
}
|
||||
@ -168,7 +168,7 @@ const QString& RimPolyLinesFromFileAnnotation::fileName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolyLinesFromFileAnnotation::readPolyLinesFile(QString * errorMessage)
|
||||
void RimPolylinesFromFileAnnotation::readPolyLinesFile(QString * errorMessage)
|
||||
{
|
||||
QFile dataFile(m_polyLinesFileName());
|
||||
|
||||
@ -239,7 +239,7 @@ void RimPolyLinesFromFileAnnotation::readPolyLinesFile(QString * errorMessage)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPolyLinesFromFileAnnotation::isEmpty()
|
||||
bool RimPolylinesFromFileAnnotation::isEmpty()
|
||||
{
|
||||
bool isThisEmpty = true;
|
||||
for (const std::vector<cvf::Vec3d> & line :m_polyLinesData->polyLines())
|
||||
@ -253,7 +253,7 @@ bool RimPolyLinesFromFileAnnotation::isEmpty()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolyLinesFromFileAnnotation::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
|
||||
void RimPolylinesFromFileAnnotation::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
|
||||
{
|
||||
m_polyLinesFileName = RimTools::relocateFile(m_polyLinesFileName(), newProjectPath, oldProjectPath, nullptr, nullptr);
|
||||
|
||||
@ -262,7 +262,7 @@ void RimPolyLinesFromFileAnnotation::updateFilePathsFromProjectPath(const QStrin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolyLinesFromFileAnnotation::setDescriptionFromFileName()
|
||||
void RimPolylinesFromFileAnnotation::setDescriptionFromFileName()
|
||||
{
|
||||
QFileInfo fileInfo(m_polyLinesFileName());
|
||||
m_userDescription = fileInfo.fileName();
|
||||
@ -272,7 +272,7 @@ void RimPolyLinesFromFileAnnotation::setDescriptionFromFileName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimPolyLinesFromFileAnnotation::userDescriptionField()
|
||||
caf::PdmFieldHandle* RimPolylinesFromFileAnnotation::userDescriptionField()
|
||||
{
|
||||
return &m_userDescription;
|
||||
}
|
@ -69,14 +69,14 @@ private:
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
class RimUserDefinedPolyLinesAnnotation : public RimPolylinesAnnotation
|
||||
class RimUserDefinedPolylinesAnnotation : public RimPolylinesAnnotation
|
||||
{
|
||||
using Vec3d = cvf::Vec3d;
|
||||
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimUserDefinedPolyLinesAnnotation();
|
||||
~RimUserDefinedPolyLinesAnnotation();
|
||||
RimUserDefinedPolylinesAnnotation();
|
||||
~RimUserDefinedPolylinesAnnotation();
|
||||
|
||||
cvf::ref<RigPolyLinesData> polyLinesData() override;
|
||||
virtual bool isEmpty() override;
|
||||
@ -95,12 +95,12 @@ private:
|
||||
//==================================================================================================
|
||||
|
||||
|
||||
class RimPolyLinesFromFileAnnotation : public RimPolylinesAnnotation
|
||||
class RimPolylinesFromFileAnnotation : public RimPolylinesAnnotation
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimPolyLinesFromFileAnnotation();
|
||||
~RimPolyLinesFromFileAnnotation();
|
||||
RimPolylinesFromFileAnnotation();
|
||||
~RimPolylinesFromFileAnnotation();
|
||||
|
||||
void setFileName(const QString& fileName);
|
||||
const QString& fileName();
|
@ -122,11 +122,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimContourMapView.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimContourMapViewCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimContourMapNameConfig.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScaleLegendConfig.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.h
|
||||
)
|
||||
|
||||
|
||||
@ -253,11 +248,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimContourMapView.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimContourMapViewCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimContourMapNameConfig.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScaleLegendConfig.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -1,28 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimAnnotationCollection.h"
|
||||
|
||||
#include "RimTextAnnotation.h"
|
||||
#include "RimReachCircleAnnotation.h"
|
||||
#include "RimPolylineAnnotation.h"
|
||||
|
||||
#include <QString>
|
||||
|
@ -1,42 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimTextAnnotation;
|
||||
class RimReachCircleAnnotation;
|
||||
class RimPolylineAnnotation;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimAnnotationCollectionInterface : public caf::PdmObject
|
||||
{
|
||||
public:
|
||||
virtual std::vector<RimTextAnnotation*> textAnnotations() const = 0;
|
||||
virtual std::vector<RimReachCircleAnnotation*> reachCircleAnnotations() const = 0;
|
||||
virtual std::vector<RimPolylineAnnotation*> polylineAnnotations() const = 0;
|
||||
};
|
@ -1,144 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimPolylineAnnotation.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "RifWellPathFormationsImporter.h"
|
||||
#include "RifWellPathImporter.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include <QString>
|
||||
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include "RimFileWellPath.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimPolylineAnnotation, "RimPolylineAnnotation");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPolylineAnnotation::RimPolylineAnnotation()
|
||||
{
|
||||
CAF_PDM_InitObject("PolylineAnnotation", ":/WellCollection.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_points, "Points", {}, "Points", "", "", "");
|
||||
}
|
||||
|
||||
RimPolylineAnnotation::~RimPolylineAnnotation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolylineAnnotation::setPoints(const std::vector<Vec3d>& points)
|
||||
{
|
||||
m_points = points;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RimPolylineAnnotation::Vec3d>& RimPolylineAnnotation::points() const
|
||||
{
|
||||
return m_points();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolylineAnnotation::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_points);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolylineAnnotation::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
auto views = gridViewsContainingAnnotations();
|
||||
if (!views.empty())
|
||||
{
|
||||
if (changedField == &m_points)
|
||||
{
|
||||
for (auto& view : views)
|
||||
{
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimGridView*> RimPolylineAnnotation::gridViewsContainingAnnotations() const
|
||||
{
|
||||
std::vector<RimGridView*> views;
|
||||
RimProject* project = nullptr;
|
||||
this->firstAncestorOrThisOfType(project);
|
||||
|
||||
if (!project) return views;
|
||||
|
||||
std::vector<RimGridView*> visibleGridViews;
|
||||
project->allVisibleGridViews(visibleGridViews);
|
||||
|
||||
for (auto& gridView : visibleGridViews)
|
||||
{
|
||||
if (gridView->annotationCollection()->isActive()) views.push_back(gridView);
|
||||
}
|
||||
return views;
|
||||
}
|
Loading…
Reference in New Issue
Block a user