2018-11-23 06:33:59 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2018-11-27 07:43:25 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-11-23 06:33:59 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-11-23 06:33:59 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2018-11-23 06:33:59 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-04-10 05:49:20 -05:00
|
|
|
#include "RiaFontCache.h"
|
2018-11-28 04:58:38 -06:00
|
|
|
#include "RimAnnotationCollectionBase.h"
|
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
#include "cafAppEnum.h"
|
|
|
|
#include "cafPdmChildArrayField.h"
|
2018-12-03 06:14:04 -06:00
|
|
|
#include "cafPdmChildField.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cafPdmField.h"
|
2018-11-23 06:33:59 -06:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
#include "cafTristate.h"
|
|
|
|
|
2018-12-03 06:14:04 -06:00
|
|
|
class RimAnnotationCollection;
|
|
|
|
class RimAnnotationGroupCollection;
|
2018-11-26 07:48:06 -06:00
|
|
|
class RimTextAnnotation;
|
2018-12-03 06:14:04 -06:00
|
|
|
class RimTextAnnotationInView;
|
|
|
|
class RimReachCircleAnnotationInView;
|
|
|
|
class RimUserDefinedPolylinesAnnotationInView;
|
|
|
|
class RimPolylinesFromFileAnnotationInView;
|
2018-11-23 06:33:59 -06:00
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
|
|
|
///
|
2018-11-23 06:33:59 -06:00
|
|
|
//==================================================================================================
|
2020-05-09 04:23:58 -05:00
|
|
|
class RimAnnotationInViewCollection : public RimAnnotationCollectionBase, public caf::FontHolderInterface
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
public:
|
2018-11-23 06:33:59 -06:00
|
|
|
RimAnnotationInViewCollection();
|
|
|
|
~RimAnnotationInViewCollection() override;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
double annotationPlaneZ() const;
|
|
|
|
bool snapAnnotations() const;
|
2018-11-23 06:33:59 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<RimTextAnnotationInView*> globalTextAnnotations() const;
|
|
|
|
std::vector<RimReachCircleAnnotationInView*> globalReachCircleAnnotations() const;
|
|
|
|
std::vector<RimUserDefinedPolylinesAnnotationInView*> globalUserDefinedPolylineAnnotations() const;
|
|
|
|
std::vector<RimPolylinesFromFileAnnotationInView*> globalPolylineFromFileAnnotations() const;
|
2018-12-03 06:14:04 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void onGlobalCollectionChanged( const RimAnnotationCollection* globalCollection );
|
2018-12-03 06:14:04 -06:00
|
|
|
|
2020-05-09 04:23:58 -05:00
|
|
|
int fontSize() const override;
|
2020-09-14 14:47:48 -05:00
|
|
|
void updateFonts() override;
|
2020-05-18 09:02:27 -05:00
|
|
|
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
|
|
|
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
2020-06-08 04:09:11 -05:00
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
protected:
|
2019-09-06 03:40:57 -05:00
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2020-02-12 04:43:15 -06:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2019-09-06 03:40:57 -05:00
|
|
|
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
|
|
|
QString uiConfigName,
|
|
|
|
caf::PdmUiEditorAttribute* attribute ) override;
|
|
|
|
|
2018-12-03 06:14:04 -06:00
|
|
|
private:
|
|
|
|
std::vector<caf::PdmObject*> allGlobalPdmAnnotations() const;
|
2019-09-06 03:40:57 -05:00
|
|
|
void addGlobalAnnotation( caf::PdmObject* annotation );
|
|
|
|
void deleteGlobalAnnotation( const caf::PdmObject* annotation );
|
2018-11-23 06:33:59 -06:00
|
|
|
|
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmField<double> m_annotationPlaneDepth;
|
|
|
|
caf::PdmField<bool> m_snapAnnotations;
|
2018-12-03 06:14:04 -06:00
|
|
|
|
2020-06-08 04:09:11 -05:00
|
|
|
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_annotationFontSize;
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmChildField<RimAnnotationGroupCollection*> m_globalTextAnnotations;
|
|
|
|
caf::PdmChildField<RimAnnotationGroupCollection*> m_globalReachCircleAnnotations;
|
|
|
|
caf::PdmChildField<RimAnnotationGroupCollection*> m_globalUserDefinedPolylineAnnotations;
|
|
|
|
caf::PdmChildField<RimAnnotationGroupCollection*> m_globalPolylineFromFileAnnotations;
|
2018-11-23 06:33:59 -06:00
|
|
|
};
|