Merge remote-tracking branch 'origin/dev' into grid-geometry-extraction

This commit is contained in:
Jørgen Herje
2024-02-27 12:48:43 +01:00
186 changed files with 3704 additions and 1204 deletions

View File

@@ -54,7 +54,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h
${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.h
${CMAKE_CURRENT_LIST_DIR}/RivAnnotationTools.h
@@ -112,7 +111,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp
${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.cpp
${CMAKE_CURRENT_LIST_DIR}/RivAnnotationTools.cpp

View File

@@ -1,88 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021 Equinor 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 "RivCellFilterPartMgr.h"
#include "Rim3dView.h"
#include "RimCellFilterCollection.h"
#include "RimPolygonFilter.h"
#include "RivPolylinePartMgr.h"
#include "cafPdmObject.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivCellFilterPartMgr::RivCellFilterPartMgr( Rim3dView* view )
: m_rimView( view )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivCellFilterPartMgr::~RivCellFilterPartMgr()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivCellFilterPartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& boundingBox )
{
createCellFilterPartManagers();
for ( auto& partMgr : m_cellFilterPartMgrs )
{
partMgr->appendDynamicGeometryPartsToModel( model, displayCoordTransform, boundingBox );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivCellFilterPartMgr::createCellFilterPartManagers()
{
std::vector<RimCellFilterCollection*> colls = m_rimView->descendantsIncludingThisOfType<RimCellFilterCollection>();
if ( colls.empty() ) return;
auto coll = colls.front();
clearGeometryCache();
for ( auto filter : coll->filters() )
{
RimPolygonFilter* polyFilter = dynamic_cast<RimPolygonFilter*>( filter );
if ( polyFilter )
{
RivPolylinePartMgr* ppm = new RivPolylinePartMgr( m_rimView, polyFilter, coll );
m_cellFilterPartMgrs.push_back( ppm );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivCellFilterPartMgr::clearGeometryCache()
{
m_cellFilterPartMgrs.clear();
}

View File

@@ -1,60 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021 Equinor 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.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmPointer.h"
#include "cvfAssert.h"
#include "cvfCollection.h"
#include "cvfObject.h"
namespace cvf
{
class BoundingBox;
class Part;
class ModelBasicList;
class Transform;
class Font;
} // namespace cvf
namespace caf
{
class DisplayCoordTransform;
}
class Rim3dView;
class RivPolylinePartMgr;
class RivCellFilterPartMgr : public cvf::Object
{
public:
RivCellFilterPartMgr( Rim3dView* view );
~RivCellFilterPartMgr() override;
void appendGeometryPartsToModel( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& boundingBox );
void clearGeometryCache();
private:
void createCellFilterPartManagers();
private:
caf::PdmPointer<Rim3dView> m_rimView;
cvf::Collection<RivPolylinePartMgr> m_cellFilterPartMgrs;
};

View File

@@ -82,7 +82,7 @@ bool RivPolylinePartMgr::isPolylinesInBoundingBox( std::vector<std::vector<cvf::
void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* displayXf, const cvf::BoundingBox& boundingBox )
{
auto polylineDef = m_polylineInterface->polyLinesData();
if ( polylineDef.isNull() || polylineDef->polyLines().empty() )
if ( polylineDef.isNull() || polylineDef->rawPolyLines().empty() )
{
clearAllGeometry();
return;
@@ -107,6 +107,7 @@ void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* d
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivPolylinePartMgr" );
part->setDrawable( drawableGeo.p() );
part->updateBoundingBox();
caf::MeshEffectGenerator effgen( polylineDef->lineColor() );
effgen.setLineWidth( polylineDef->lineThickness() );
@@ -177,6 +178,7 @@ void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* d
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivPolylinePartMgr" );
part->setDrawable( vectorDrawable.p() );
part->updateBoundingBox();
part->setEffect( new cvf::Effect() );
part->setPriority( RivPartPriority::PartType::MeshLines );
@@ -190,7 +192,7 @@ void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* d
//--------------------------------------------------------------------------------------------------
std::vector<std::vector<cvf::Vec3d>> RivPolylinePartMgr::getPolylinesPointsInDomain( RigPolyLinesData* lineDef )
{
auto polylines = lineDef->polyLines();
auto polylines = lineDef->rawPolyLines();
if ( !lineDef->lockToZPlane() ) return polylines;
const double planeZ = lineDef->lockedZValue();