2018-11-27 07:27:02 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2018-11-27 07:43:25 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-11-27 07:27:02 -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.
|
|
|
|
//
|
|
|
|
// 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 "RimLineBasedAnnotation.h"
|
|
|
|
|
2018-11-28 05:07:39 -06:00
|
|
|
#include "RimAnnotationLineAppearance.h"
|
2018-12-03 06:14:04 -06:00
|
|
|
#include "RimAnnotationCollectionBase.h"
|
2018-11-28 05:07:39 -06:00
|
|
|
|
2018-11-27 07:27:02 -06:00
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimLineBasedAnnotation, "RimLineBasedAnnotation");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimLineBasedAnnotation::RimLineBasedAnnotation()
|
|
|
|
{
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_appearance, "LineAppearance", "Line Appearance", "", "", "");
|
|
|
|
|
|
|
|
m_appearance = new RimAnnotationLineAppearance();
|
|
|
|
m_appearance.uiCapability()->setUiTreeHidden(true);
|
|
|
|
m_appearance.uiCapability()->setUiTreeChildrenHidden(true);
|
2018-11-28 08:40:20 -06:00
|
|
|
|
2018-11-28 07:18:10 -06:00
|
|
|
CAF_PDM_InitField(&m_isActive, "IsActive", true, "Is Active", "", "", "");
|
|
|
|
m_isActive.uiCapability()->setUiHidden(true);
|
2018-11-27 07:27:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimAnnotationLineAppearance* RimLineBasedAnnotation::appearance() const
|
|
|
|
{
|
|
|
|
return m_appearance;
|
|
|
|
}
|
2018-11-28 07:18:10 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimLineBasedAnnotation::isActive()
|
|
|
|
{
|
|
|
|
return m_isActive();
|
|
|
|
}
|
|
|
|
|
2018-12-03 06:14:04 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimLineBasedAnnotation::isVisible()
|
|
|
|
{
|
|
|
|
RimAnnotationCollectionBase* coll;
|
|
|
|
firstAncestorOrThisOfType(coll);
|
|
|
|
|
|
|
|
return coll && coll->isActive() && m_isActive;
|
|
|
|
}
|
|
|
|
|
2018-11-28 07:18:10 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
caf::PdmFieldHandle* RimLineBasedAnnotation::objectToggleField()
|
|
|
|
{
|
|
|
|
return &m_isActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|