2015-06-11 04:38:51 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- 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>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
2015-11-26 09:00:08 -06:00
|
|
|
|
|
|
|
#include "cvfStructGrid.h"
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
2015-06-11 04:38:51 -05:00
|
|
|
#include <QObject>
|
2015-11-26 09:00:08 -06:00
|
|
|
#include <QPointer>
|
2015-06-11 04:38:51 -05:00
|
|
|
|
2016-09-26 03:35:59 -05:00
|
|
|
class RicViewerEventInterface;
|
2015-06-30 08:37:53 -05:00
|
|
|
class RimEclipseView;
|
|
|
|
class RimGeoMechView;
|
2016-09-26 03:35:59 -05:00
|
|
|
class RimIntersection;
|
2018-01-09 03:11:28 -06:00
|
|
|
class Rim3dView;
|
2015-11-26 09:00:08 -06:00
|
|
|
class RiuViewer;
|
2016-09-26 03:35:59 -05:00
|
|
|
class RivIntersectionBoxSourceInfo;
|
2016-09-21 03:40:08 -05:00
|
|
|
class RivIntersectionSourceInfo;
|
2018-08-27 07:27:33 -05:00
|
|
|
class RiuPickItemInfo;
|
2015-06-30 08:37:53 -05:00
|
|
|
|
2015-06-11 04:38:51 -05:00
|
|
|
class QMouseEvent;
|
|
|
|
|
2016-09-27 04:59:06 -05:00
|
|
|
namespace caf {
|
|
|
|
class PdmObject;
|
|
|
|
}
|
|
|
|
|
2015-06-11 04:38:51 -05:00
|
|
|
namespace cvf {
|
|
|
|
class HitItemCollection;
|
|
|
|
class Part;
|
|
|
|
}
|
|
|
|
|
|
|
|
class RiuViewerCommands: public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-03-06 04:19:51 -06:00
|
|
|
explicit RiuViewerCommands(RiuViewer* ownerViewer);
|
2015-06-11 04:38:51 -05:00
|
|
|
~RiuViewerCommands();
|
|
|
|
|
2018-01-09 03:11:28 -06:00
|
|
|
void setOwnerView(Rim3dView * owner);
|
2015-06-11 04:38:51 -05:00
|
|
|
|
|
|
|
void displayContextMenu(QMouseEvent* event);
|
2015-11-05 05:32:29 -06:00
|
|
|
void handlePickAction(int winPosX, int winPosY, Qt::KeyboardModifiers keyboardModifiers);
|
2016-09-23 09:12:19 -05:00
|
|
|
cvf::Vec3d lastPickPositionInDomainCoords() const;
|
2015-06-11 04:38:51 -05:00
|
|
|
|
|
|
|
private:
|
2016-09-26 03:35:59 -05:00
|
|
|
void findCellAndGridIndex(const RivIntersectionSourceInfo* crossSectionSourceInfo, cvf::uint firstPartTriangleIndex, size_t* cellIndex, size_t* gridIndex);
|
|
|
|
void findCellAndGridIndex(const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo, cvf::uint firstPartTriangleIndex, size_t* cellIndex, size_t* gridIndex);
|
|
|
|
|
2015-06-11 04:38:51 -05:00
|
|
|
void ijkFromCellIndex(size_t gridIdx, size_t cellIndex, size_t* i, size_t* j, size_t* k);
|
2018-08-27 07:27:33 -05:00
|
|
|
|
|
|
|
void findFirstItems(const std::vector<RiuPickItemInfo> & pickItemInfos,
|
|
|
|
size_t* indexToFirstNoneNncItem,
|
|
|
|
size_t* indexToNncItemNearFirsItem);
|
2015-06-30 08:37:53 -05:00
|
|
|
|
2015-12-07 02:59:19 -06:00
|
|
|
bool handleOverlayItemPicking(int winPosX, int winPosY);
|
|
|
|
|
2018-02-24 02:17:02 -06:00
|
|
|
private:
|
|
|
|
size_t m_currentGridIdx;
|
|
|
|
size_t m_currentCellIndex;
|
|
|
|
cvf::StructGridInterface::FaceType m_currentFaceIndex;
|
|
|
|
cvf::Vec3d m_currentPickPositionInDomainCoords;
|
|
|
|
caf::PdmPointer<Rim3dView> m_reservoirView;
|
|
|
|
QPointer<RiuViewer> m_viewer;
|
2015-12-04 08:15:13 -06:00
|
|
|
std::vector<RicViewerEventInterface*> m_viewerEventHandlers;
|
2015-06-11 04:38:51 -05:00
|
|
|
};
|