2020-08-24 11:09:22 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2026-05-12 14:24:43 +02:00
|
|
|
// Copyright (C) 2026 Equinor ASA
|
2020-08-24 11:09:22 +02: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.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2026-05-12 14:24:43 +02:00
|
|
|
#include "RimPolygonContainer.h"
|
2020-08-24 11:09:22 +02:00
|
|
|
|
2026-05-12 14:24:43 +02:00
|
|
|
#include "RimPolygon.h"
|
|
|
|
|
#include "RimPolygonCollection.h"
|
2020-08-24 11:09:22 +02:00
|
|
|
|
2026-05-12 14:24:43 +02:00
|
|
|
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimPolygonContainer, "RimPolygonContainer" ); // Abstract class
|
2020-08-24 11:09:22 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2026-05-12 14:24:43 +02:00
|
|
|
RimPolygonContainer::RimPolygonContainer()
|
2020-08-24 11:09:22 +02:00
|
|
|
{
|
2026-05-12 14:24:43 +02:00
|
|
|
CAF_PDM_InitObject( "Polygon Container" );
|
2020-08-24 11:09:22 +02:00
|
|
|
|
2026-05-12 14:24:43 +02:00
|
|
|
// m_collectionName, m_subCollections and m_items are initialized by derived classes
|
|
|
|
|
// with derived-specific XML keywords, matching the caf::PdmNestedCollection convention.
|
2020-08-24 11:09:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2026-05-12 14:24:43 +02:00
|
|
|
RimPolygonContainer* RimPolygonContainer::addNewSubCollection()
|
2020-08-24 11:09:22 +02:00
|
|
|
{
|
2026-05-12 14:24:43 +02:00
|
|
|
auto* sub = new RimPolygonCollection();
|
|
|
|
|
addSubCollection( sub );
|
|
|
|
|
return sub;
|
2020-08-24 11:09:22 +02:00
|
|
|
}
|
2026-05-13 14:13:17 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimPolygonContainer::loadData()
|
|
|
|
|
{
|
|
|
|
|
for ( auto* sub : subCollections() )
|
|
|
|
|
{
|
|
|
|
|
if ( sub ) sub->loadData();
|
|
|
|
|
}
|
|
|
|
|
}
|