Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use project polygons from polygon cell filter #11214

Merged
merged 15 commits into from
Feb 22, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "RicNewPolygonFilter3dviewFeature.h"

#include "Polygons/RimPolygonInView.h"

#include "RiaApplication.h"
#include "RimCase.h"
#include "RimCellFilterCollection.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

#include "RicNewPolygonFilterFeature.h"

#include "Polygons/RimPolygonInView.h"

#include "RimCase.h"
#include "RimCellFilterCollection.h"
#include "RimPolygonFilter.h"

#include "Riu3DMainWindowTools.h"

#include "cafSelectionManagerTools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2022 Equinor ASA
// Copyright (C) 2024 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h
${CMAKE_CURRENT_LIST_DIR}/RicAppendPointsToPolygonFilterFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDuplicateWellPathFeature.h
)

Expand Down Expand Up @@ -66,7 +65,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.cpp
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.cpp
${CMAKE_CURRENT_LIST_DIR}/RicAppendPointsToPolygonFilterFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDuplicateWellPathFeature.cpp
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "RicPointTangentManipulator.h"

#include "Rim3dView.h"
#include "RimPolylinePickerInterface.h"
#include "RimPolylineTarget.h"

#include "RiuViewer.h"
Expand Down Expand Up @@ -96,8 +97,13 @@ void RicPolylineTarget3dEditor::configureAndUpdateUi( const QString& uiConfigNam

cvf::ref<caf::DisplayCoordTransform> dispXf = view->displayCoordTransform();

const double handleScalingFactor = 0.7;
const double handleSize = handleScalingFactor * view->characteristicCellSize();
double scalingFactor = 0.7;
if ( auto pickerInterface = target->firstAncestorOrThisOfType<RimPolylinePickerInterface>() )
{
scalingFactor *= pickerInterface->scalingFactorForTarget();
}

const double handleSize = scalingFactor * view->characteristicCellSize();

m_manipulator->setOrigin( dispXf->transformToDisplayCoord( target->targetPointXYZ() ) );
m_manipulator->setHandleSize( handleSize );
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
88 changes: 0 additions & 88 deletions ApplicationLibCode/ModelVisualization/RivCellFilterPartMgr.cpp

This file was deleted.

60 changes: 0 additions & 60 deletions ApplicationLibCode/ModelVisualization/RivCellFilterPartMgr.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ RimPolygonFilter* RimCellFilterCollection::addNewPolygonFilter( RimCase* srcCase
RimPolygonFilter* pFilter = new RimPolygonFilter();
pFilter->setCase( srcCase );
addFilter( pFilter );
pFilter->configurePolygonEditor();
pFilter->enablePicking( true );
onFilterUpdated( pFilter );
return pFilter;
Expand Down Expand Up @@ -485,3 +486,21 @@ void RimCellFilterCollection::updateCellVisibilityByIndex( cvf::UByteArray* incl
}
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimPolygonInView*> RimCellFilterCollection::cellFilterPolygons() const
{
std::vector<RimPolygonInView*> polyInView;

for ( const auto& filter : m_cellFilters )
{
if ( auto polygonFilter = dynamic_cast<RimPolygonFilter*>( filter.p() ) )
{
polyInView.push_back( polygonFilter->polygonInView() );
}
}

return polyInView;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class RimPolygonFilter;
class RimUserDefinedFilter;
class RimUserDefinedIndexFilter;
class RimCase;
class RimPolygonInView;

namespace cvf
{
Expand Down Expand Up @@ -69,7 +70,8 @@ class RimCellFilterCollection : public caf::PdmObject
void compoundCellRangeFilter( cvf::CellRangeFilter* cellRangeFilter, size_t gridIndex ) const;
void updateCellVisibilityByIndex( cvf::UByteArray* cellsIncluded, cvf::UByteArray* cellsExcluded, size_t gridIndex ) const;

std::vector<RimCellFilter*> filters() const;
std::vector<RimPolygonInView*> cellFilterPolygons() const;
std::vector<RimCellFilter*> filters() const;

bool hasActiveFilters() const;
bool hasActiveIncludeIndexFilters() const;
Expand Down
Loading
Loading