#4683 clang-format on all files in ApplicationCode

This commit is contained in:
Magne Sjaastad
2019-09-06 10:40:57 +02:00
parent 3a317504bb
commit fe9e567825
2092 changed files with 117952 additions and 111846 deletions

View File

@@ -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;
}