mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#include "RiuViewer.h"
|
||||
#include "cvfCamera.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewIntersectionViewFeature, "RicNewIntersectionViewFeature");
|
||||
CAF_CMD_SOURCE_INIT( RicNewIntersectionViewFeature, "RicNewIntersectionViewFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -48,30 +48,33 @@ bool RicNewIntersectionViewFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewIntersectionViewFeature::onActionTriggered(bool isChecked)
|
||||
void RicNewIntersectionViewFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
std::set<RimIntersection*> intersections = selectedIntersections();
|
||||
|
||||
Rim2dIntersectionView* objectToSelect = nullptr;
|
||||
|
||||
for (auto intersection : intersections)
|
||||
for ( auto intersection : intersections )
|
||||
{
|
||||
if (!intersection) continue;
|
||||
if ( !intersection ) continue;
|
||||
|
||||
RimCase* rimCase = nullptr;
|
||||
intersection->firstAncestorOrThisOfType(rimCase);
|
||||
if (rimCase)
|
||||
intersection->firstAncestorOrThisOfType( rimCase );
|
||||
if ( rimCase )
|
||||
{
|
||||
if (intersection->direction() != RimIntersection::CS_VERTICAL)
|
||||
if ( intersection->direction() != RimIntersection::CS_VERTICAL )
|
||||
{
|
||||
QString text = QString("The intersection view only supports vertical intersections.\n"
|
||||
"The intersection '%1' is not vertical but a converted version will be shown in the view .").arg(intersection->name());
|
||||
QString text =
|
||||
QString(
|
||||
"The intersection view only supports vertical intersections.\n"
|
||||
"The intersection '%1' is not vertical but a converted version will be shown in the view ." )
|
||||
.arg( intersection->name() );
|
||||
|
||||
QMessageBox::warning(Riu3DMainWindowTools::mainWindowWidget(), "New Intersection View", text);
|
||||
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "New Intersection View", text );
|
||||
}
|
||||
|
||||
Rim2dIntersectionView* intersectionView = intersection->correspondingIntersectionView();
|
||||
intersectionView->setVisible(true);
|
||||
intersectionView->setVisible( true );
|
||||
intersectionView->loadDataAndUpdate();
|
||||
|
||||
intersectionView->updateConnectedEditors();
|
||||
@@ -80,18 +83,18 @@ void RicNewIntersectionViewFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
if (objectToSelect)
|
||||
if ( objectToSelect )
|
||||
{
|
||||
//RiuMainWindow::instance()->selectAsCurrentItem(objectToSelect);
|
||||
// RiuMainWindow::instance()->selectAsCurrentItem(objectToSelect);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewIntersectionViewFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicNewIntersectionViewFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText("Show 2D Intersection View");
|
||||
actionToSetup->setText( "Show 2D Intersection View" );
|
||||
// actionToSetup->setIcon(QIcon(":/chain.png"));
|
||||
}
|
||||
|
||||
@@ -103,15 +106,15 @@ std::set<RimIntersection*> RicNewIntersectionViewFeature::selectedIntersections(
|
||||
std::set<RimIntersection*> objects;
|
||||
|
||||
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
|
||||
RiuSelectionItem* selItem = riuSelManager->selectedItem(Riu3dSelectionManager::RUI_TEMPORARY);
|
||||
RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY );
|
||||
|
||||
RiuGeneralSelectionItem* generalSelectionItem = static_cast<RiuGeneralSelectionItem*>(selItem);
|
||||
if (generalSelectionItem)
|
||||
RiuGeneralSelectionItem* generalSelectionItem = static_cast<RiuGeneralSelectionItem*>( selItem );
|
||||
if ( generalSelectionItem )
|
||||
{
|
||||
RimIntersection* intersection = dynamic_cast<RimIntersection*>(generalSelectionItem->m_object);
|
||||
if (intersection)
|
||||
RimIntersection* intersection = dynamic_cast<RimIntersection*>( generalSelectionItem->m_object );
|
||||
if ( intersection )
|
||||
{
|
||||
objects.insert(intersection);
|
||||
objects.insert( intersection );
|
||||
|
||||
// Return only the intersection the user clicked on
|
||||
|
||||
@@ -121,9 +124,9 @@ std::set<RimIntersection*> RicNewIntersectionViewFeature::selectedIntersections(
|
||||
|
||||
{
|
||||
std::vector<RimIntersection*> selectedObjects = caf::selectedObjectsByType<RimIntersection*>();
|
||||
for (auto obj : selectedObjects)
|
||||
for ( auto obj : selectedObjects )
|
||||
{
|
||||
objects.insert(obj);
|
||||
objects.insert( obj );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user