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:
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -19,9 +19,9 @@
|
||||
#include "RicAppendIntersectionBoxFeature.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimGridView.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafCmdExecCommandManager.h"
|
||||
@@ -31,67 +31,66 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicAppendIntersectionBoxFeature, "RicAppendIntersectionBoxFeature");
|
||||
CAF_CMD_SOURCE_INIT( RicAppendIntersectionBoxFeature, "RicAppendIntersectionBoxFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicAppendIntersectionBoxFeature::isCommandEnabled()
|
||||
{
|
||||
RimIntersectionCollection* coll = RicAppendIntersectionBoxFeature::intersectionCollection();
|
||||
if (coll) return true;
|
||||
if ( coll ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked)
|
||||
void RicAppendIntersectionBoxFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimIntersectionCollection* coll = RicAppendIntersectionBoxFeature::intersectionCollection();
|
||||
|
||||
if (coll)
|
||||
if ( coll )
|
||||
{
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString("Intersection Box");
|
||||
intersectionBox->name = QString( "Intersection Box" );
|
||||
|
||||
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||
coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
|
||||
intersectionBox->setToDefaultSizeBox();
|
||||
|
||||
coll->updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem(intersectionBox);
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( intersectionBox );
|
||||
|
||||
RimGridView* rimView = nullptr;
|
||||
coll->firstAncestorOrThisOfTypeAsserted(rimView);
|
||||
rimView->showGridCells(false);
|
||||
coll->firstAncestorOrThisOfTypeAsserted( rimView );
|
||||
rimView->showGridCells( false );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendIntersectionBoxFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicAppendIntersectionBoxFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/IntersectionBox16x16.png"));
|
||||
actionToSetup->setText("New Intersection Box");
|
||||
actionToSetup->setIcon( QIcon( ":/IntersectionBox16x16.png" ) );
|
||||
actionToSetup->setText( "New Intersection Box" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionCollection* RicAppendIntersectionBoxFeature::intersectionCollection()
|
||||
{
|
||||
RimIntersectionCollection* intersectionBoxColl = nullptr;
|
||||
|
||||
std::vector<caf::PdmObjectHandle*> selectedObjects;
|
||||
caf::SelectionManager::instance()->objectsByType(&selectedObjects);
|
||||
if (selectedObjects.size() == 1)
|
||||
caf::SelectionManager::instance()->objectsByType( &selectedObjects );
|
||||
if ( selectedObjects.size() == 1 )
|
||||
{
|
||||
selectedObjects[0]->firstAncestorOrThisOfType(intersectionBoxColl);
|
||||
selectedObjects[0]->firstAncestorOrThisOfType( intersectionBoxColl );
|
||||
}
|
||||
|
||||
return intersectionBoxColl;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
class RimIntersectionCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicAppendIntersectionBoxFeature : public caf::CmdFeature
|
||||
{
|
||||
@@ -40,4 +40,3 @@ protected:
|
||||
private:
|
||||
static RimIntersectionCollection* intersectionCollection();
|
||||
};
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
//
|
||||
// Copyright (C) 2013- Statoil ASA
|
||||
// Copyright (C) 2013- Ceetron Solutions AS
|
||||
//
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -34,69 +34,69 @@
|
||||
#include <QMouseEvent>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicBoxManipulatorEventHandler::RicBoxManipulatorEventHandler(caf::Viewer* viewer)
|
||||
: m_viewer(viewer)
|
||||
RicBoxManipulatorEventHandler::RicBoxManipulatorEventHandler( caf::Viewer* viewer )
|
||||
: m_viewer( viewer )
|
||||
{
|
||||
m_partManager = new caf::BoxManipulatorPartManager;
|
||||
|
||||
m_viewer->installEventFilter(this);
|
||||
m_viewer->installEventFilter( this );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicBoxManipulatorEventHandler::~RicBoxManipulatorEventHandler()
|
||||
{
|
||||
if (m_viewer) m_viewer->removeEventFilter(this);
|
||||
if ( m_viewer ) m_viewer->removeEventFilter( this );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicBoxManipulatorEventHandler::setOrigin(const cvf::Vec3d& origin)
|
||||
void RicBoxManipulatorEventHandler::setOrigin( const cvf::Vec3d& origin )
|
||||
{
|
||||
m_partManager->setOrigin(origin);
|
||||
m_partManager->setOrigin( origin );
|
||||
|
||||
emit notifyRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicBoxManipulatorEventHandler::setSize(const cvf::Vec3d& size)
|
||||
void RicBoxManipulatorEventHandler::setSize( const cvf::Vec3d& size )
|
||||
{
|
||||
m_partManager->setSize(size);
|
||||
|
||||
m_partManager->setSize( size );
|
||||
|
||||
emit notifyRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicBoxManipulatorEventHandler::appendPartsToModel(cvf::ModelBasicList* model)
|
||||
void RicBoxManipulatorEventHandler::appendPartsToModel( cvf::ModelBasicList* model )
|
||||
{
|
||||
m_partManager->appendPartsToModel(model);
|
||||
m_partManager->appendPartsToModel( model );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicBoxManipulatorEventHandler::eventFilter(QObject *obj, QEvent* inputEvent)
|
||||
bool RicBoxManipulatorEventHandler::eventFilter( QObject* obj, QEvent* inputEvent )
|
||||
{
|
||||
if (inputEvent->type() == QEvent::MouseButtonPress)
|
||||
if ( inputEvent->type() == QEvent::MouseButtonPress )
|
||||
{
|
||||
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(inputEvent);
|
||||
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>( inputEvent );
|
||||
|
||||
if (mouseEvent->button() == Qt::LeftButton)
|
||||
if ( mouseEvent->button() == Qt::LeftButton )
|
||||
{
|
||||
cvf::HitItemCollection hitItems;
|
||||
if (m_viewer->rayPick(mouseEvent->x(), mouseEvent->y(), &hitItems))
|
||||
if ( m_viewer->rayPick( mouseEvent->x(), mouseEvent->y(), &hitItems ) )
|
||||
{
|
||||
m_partManager->tryToActivateManipulator(hitItems.firstItem());
|
||||
m_partManager->tryToActivateManipulator( hitItems.firstItem() );
|
||||
|
||||
if(m_partManager->isManipulatorActive())
|
||||
if ( m_partManager->isManipulatorActive() )
|
||||
{
|
||||
emit notifyRedraw();
|
||||
|
||||
@@ -105,27 +105,28 @@ bool RicBoxManipulatorEventHandler::eventFilter(QObject *obj, QEvent* inputEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (inputEvent->type() == QEvent::MouseMove)
|
||||
else if ( inputEvent->type() == QEvent::MouseMove )
|
||||
{
|
||||
if (m_partManager->isManipulatorActive())
|
||||
if ( m_partManager->isManipulatorActive() )
|
||||
{
|
||||
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(inputEvent);
|
||||
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>( inputEvent );
|
||||
|
||||
//qDebug() << "Inside mouse move";
|
||||
//qDebug() << mouseEvent->pos();
|
||||
// qDebug() << "Inside mouse move";
|
||||
// qDebug() << mouseEvent->pos();
|
||||
|
||||
int translatedMousePosX = mouseEvent->pos().x();
|
||||
int translatedMousePosY = m_viewer->height() - mouseEvent->pos().y();
|
||||
|
||||
cvf::ref<cvf::Ray> ray = m_viewer->mainCamera()->rayFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
|
||||
cvf::ref<cvf::Ray> ray = m_viewer->mainCamera()->rayFromWindowCoordinates( translatedMousePosX,
|
||||
translatedMousePosY );
|
||||
{
|
||||
m_partManager->updateManipulatorFromRay(ray.p());
|
||||
m_partManager->updateManipulatorFromRay( ray.p() );
|
||||
|
||||
cvf::Vec3d origin;
|
||||
cvf::Vec3d size;
|
||||
m_partManager->originAndSize(&origin, &size);
|
||||
m_partManager->originAndSize( &origin, &size );
|
||||
|
||||
emit notifyUpdate(origin, size);
|
||||
emit notifyUpdate( origin, size );
|
||||
|
||||
emit notifyRedraw();
|
||||
|
||||
@@ -133,17 +134,17 @@ bool RicBoxManipulatorEventHandler::eventFilter(QObject *obj, QEvent* inputEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (inputEvent->type() == QEvent::MouseButtonRelease)
|
||||
else if ( inputEvent->type() == QEvent::MouseButtonRelease )
|
||||
{
|
||||
if (m_partManager->isManipulatorActive())
|
||||
if ( m_partManager->isManipulatorActive() )
|
||||
{
|
||||
m_partManager->endManipulator();
|
||||
|
||||
cvf::Vec3d origin;
|
||||
cvf::Vec3d size;
|
||||
m_partManager->originAndSize(&origin, &size);
|
||||
m_partManager->originAndSize( &origin, &size );
|
||||
|
||||
emit notifyUpdate(origin, size);
|
||||
emit notifyUpdate( origin, size );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -151,4 +152,3 @@ bool RicBoxManipulatorEventHandler::eventFilter(QObject *obj, QEvent* inputEvent
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,46 +2,44 @@
|
||||
//
|
||||
// Copyright (C) 2013- Statoil ASA
|
||||
// Copyright (C) 2013- Ceetron Solutions AS
|
||||
//
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "cvfObject.h"
|
||||
#include "cvfMatrix4.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
namespace cvf {
|
||||
class Model;
|
||||
class ModelBasicList;
|
||||
};
|
||||
namespace cvf
|
||||
{
|
||||
class Model;
|
||||
class ModelBasicList;
|
||||
}; // namespace cvf
|
||||
|
||||
|
||||
namespace caf {
|
||||
class BoxManipulatorPartManager;
|
||||
class Viewer;
|
||||
};
|
||||
namespace caf
|
||||
{
|
||||
class BoxManipulatorPartManager;
|
||||
class Viewer;
|
||||
}; // namespace caf
|
||||
|
||||
class QMouseEvent;
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
@@ -51,24 +49,23 @@ class RicBoxManipulatorEventHandler : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RicBoxManipulatorEventHandler(caf::Viewer* viewer);
|
||||
explicit RicBoxManipulatorEventHandler( caf::Viewer* viewer );
|
||||
~RicBoxManipulatorEventHandler() override;
|
||||
|
||||
void setOrigin(const cvf::Vec3d& origin);
|
||||
void setSize(const cvf::Vec3d& size);
|
||||
void setOrigin( const cvf::Vec3d& origin );
|
||||
void setSize( const cvf::Vec3d& size );
|
||||
|
||||
void appendPartsToModel(cvf::ModelBasicList* model);
|
||||
void appendPartsToModel( cvf::ModelBasicList* model );
|
||||
|
||||
signals:
|
||||
void notifyRedraw();
|
||||
void notifyUpdate(const cvf::Vec3d& origin, const cvf::Vec3d& size);
|
||||
void notifyRedraw();
|
||||
void notifyUpdate( const cvf::Vec3d& origin, const cvf::Vec3d& size );
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
bool eventFilter( QObject* obj, QEvent* event ) override;
|
||||
|
||||
private:
|
||||
QPointer<caf::Viewer> m_viewer;
|
||||
QPointer<caf::Viewer> m_viewer;
|
||||
|
||||
cvf::ref<caf::BoxManipulatorPartManager> m_partManager;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuViewer.h"
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicIntersectionBoxAtPosFeature, "RicIntersectionBoxAtPosFeature");
|
||||
CAF_CMD_SOURCE_INIT( RicIntersectionBoxAtPosFeature, "RicIntersectionBoxAtPosFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicIntersectionBoxAtPosFeature::isCommandEnabled()
|
||||
{
|
||||
@@ -46,32 +46,32 @@ bool RicIntersectionBoxAtPosFeature::isCommandEnabled()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxAtPosFeature::onActionTriggered(bool isChecked)
|
||||
void RicIntersectionBoxAtPosFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
if (activeView)
|
||||
if ( activeView )
|
||||
{
|
||||
RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
CVF_ASSERT(coll);
|
||||
CVF_ASSERT( coll );
|
||||
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString("Intersection box");
|
||||
intersectionBox->name = QString( "Intersection box" );
|
||||
|
||||
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||
coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_NONE, domainCoord);
|
||||
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_NONE, domainCoord );
|
||||
|
||||
coll->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
|
||||
|
||||
RimGridView* rimView = nullptr;
|
||||
coll->firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
coll->firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->showGridCells(false);
|
||||
rimView->showGridCells( false );
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
@@ -80,11 +80,10 @@ void RicIntersectionBoxAtPosFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxAtPosFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicIntersectionBoxAtPosFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/IntersectionBox16x16.png"));
|
||||
actionToSetup->setText("Intersection Box");
|
||||
actionToSetup->setIcon( QIcon( ":/IntersectionBox16x16.png" ) );
|
||||
actionToSetup->setText( "Intersection Box" );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicIntersectionBoxAtPosFeature : public caf::CmdFeature
|
||||
{
|
||||
@@ -36,4 +35,3 @@ protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuViewer.h"
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicIntersectionBoxXSliceFeature, "RicIntersectionBoxXSliceFeature");
|
||||
CAF_CMD_SOURCE_INIT( RicIntersectionBoxXSliceFeature, "RicIntersectionBoxXSliceFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicIntersectionBoxXSliceFeature::isCommandEnabled()
|
||||
{
|
||||
@@ -46,32 +46,32 @@ bool RicIntersectionBoxXSliceFeature::isCommandEnabled()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxXSliceFeature::onActionTriggered(bool isChecked)
|
||||
void RicIntersectionBoxXSliceFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
if (activeView)
|
||||
if ( activeView )
|
||||
{
|
||||
RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
CVF_ASSERT(coll);
|
||||
CVF_ASSERT( coll );
|
||||
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString("X-slice (Intersection box)");
|
||||
intersectionBox->name = QString( "X-slice (Intersection box)" );
|
||||
|
||||
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||
coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_X, domainCoord);
|
||||
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_X, domainCoord );
|
||||
|
||||
coll->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
|
||||
|
||||
RimGridView* rimView = nullptr;
|
||||
coll->firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
coll->firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->showGridCells(false);
|
||||
rimView->showGridCells( false );
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
@@ -80,11 +80,10 @@ void RicIntersectionBoxXSliceFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxXSliceFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicIntersectionBoxXSliceFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/IntersectionXPlane16x16.png"));
|
||||
actionToSetup->setText("X-slice Intersection Box");
|
||||
actionToSetup->setIcon( QIcon( ":/IntersectionXPlane16x16.png" ) );
|
||||
actionToSetup->setText( "X-slice Intersection Box" );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicIntersectionBoxXSliceFeature : public caf::CmdFeature
|
||||
{
|
||||
@@ -36,4 +35,3 @@ protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuViewer.h"
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicIntersectionBoxYSliceFeature, "RicIntersectionBoxYSliceFeature");
|
||||
CAF_CMD_SOURCE_INIT( RicIntersectionBoxYSliceFeature, "RicIntersectionBoxYSliceFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicIntersectionBoxYSliceFeature::isCommandEnabled()
|
||||
{
|
||||
@@ -46,32 +46,32 @@ bool RicIntersectionBoxYSliceFeature::isCommandEnabled()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxYSliceFeature::onActionTriggered(bool isChecked)
|
||||
void RicIntersectionBoxYSliceFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
if (activeView)
|
||||
if ( activeView )
|
||||
{
|
||||
RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
CVF_ASSERT(coll);
|
||||
CVF_ASSERT( coll );
|
||||
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString("Y-slice (Intersection box)");
|
||||
intersectionBox->name = QString( "Y-slice (Intersection box)" );
|
||||
|
||||
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||
coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Y, domainCoord);
|
||||
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Y, domainCoord );
|
||||
|
||||
coll->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
|
||||
|
||||
RimGridView* rimView = nullptr;
|
||||
coll->firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
coll->firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->showGridCells(false);
|
||||
rimView->showGridCells( false );
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
@@ -80,11 +80,10 @@ void RicIntersectionBoxYSliceFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxYSliceFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicIntersectionBoxYSliceFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/IntersectionYPlane16x16.png"));
|
||||
actionToSetup->setText("Y-slice Intersection Box");
|
||||
actionToSetup->setIcon( QIcon( ":/IntersectionYPlane16x16.png" ) );
|
||||
actionToSetup->setText( "Y-slice Intersection Box" );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicIntersectionBoxYSliceFeature : public caf::CmdFeature
|
||||
{
|
||||
@@ -36,4 +35,3 @@ protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuViewer.h"
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicIntersectionBoxZSliceFeature, "RicIntersectionBoxZSliceFeature");
|
||||
CAF_CMD_SOURCE_INIT( RicIntersectionBoxZSliceFeature, "RicIntersectionBoxZSliceFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicIntersectionBoxZSliceFeature::isCommandEnabled()
|
||||
{
|
||||
@@ -46,31 +46,31 @@ bool RicIntersectionBoxZSliceFeature::isCommandEnabled()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxZSliceFeature::onActionTriggered(bool isChecked)
|
||||
void RicIntersectionBoxZSliceFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
if (activeView)
|
||||
if ( activeView )
|
||||
{
|
||||
RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
CVF_ASSERT(coll);
|
||||
CVF_ASSERT( coll );
|
||||
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString("Z-slice (Intersection box)");
|
||||
intersectionBox->name = QString( "Z-slice (Intersection box)" );
|
||||
|
||||
coll->appendIntersectionBoxAndUpdate(intersectionBox);
|
||||
coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Z, domainCoord);
|
||||
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Z, domainCoord );
|
||||
|
||||
coll->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
|
||||
|
||||
RimGridView* rimView = nullptr;
|
||||
coll->firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
coll->firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->showGridCells(false);
|
||||
rimView->showGridCells( false );
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
@@ -79,11 +79,10 @@ void RicIntersectionBoxZSliceFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxZSliceFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicIntersectionBoxZSliceFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/IntersectionZPlane16x16.png"));
|
||||
actionToSetup->setText("Z-slice Intersection Box");
|
||||
actionToSetup->setIcon( QIcon( ":/IntersectionZPlane16x16.png" ) );
|
||||
actionToSetup->setText( "Z-slice Intersection Box" );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicIntersectionBoxZSliceFeature : public caf::CmdFeature
|
||||
{
|
||||
@@ -36,4 +35,3 @@ protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user