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:
@@ -2,33 +2,32 @@
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfStructGrid.h"
|
||||
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
// #include "RivWellPathSourceInfo.h"
|
||||
// #include "RivWellPipeSourceInfo.h"
|
||||
|
||||
@@ -46,7 +45,7 @@ class RivWellPathSourceInfo;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class Riu3dSelectionManager
|
||||
@@ -54,8 +53,8 @@ class Riu3dSelectionManager
|
||||
public:
|
||||
enum SelectionRole
|
||||
{
|
||||
RUI_APPLICATION_GLOBAL, // Selection role intended to manage the cells selected by left mouse click in the 3D view
|
||||
RUI_TEMPORARY // Selection role intended to manage the items selected by a right mouse click in the 3D view
|
||||
RUI_APPLICATION_GLOBAL, // Selection role intended to manage the cells selected by left mouse click in the 3D view
|
||||
RUI_TEMPORARY // Selection role intended to manage the items selected by a right mouse click in the 3D view
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -63,44 +62,42 @@ public:
|
||||
|
||||
// Returns selected items
|
||||
// Selection manager owns the selection items
|
||||
void selectedItems(std::vector<RiuSelectionItem*>& items, int role = RUI_APPLICATION_GLOBAL) const;
|
||||
void selectedItems( std::vector<RiuSelectionItem*>& items, int role = RUI_APPLICATION_GLOBAL ) const;
|
||||
|
||||
// Returns selected items
|
||||
// Selection manager owns the selection items
|
||||
RiuSelectionItem* selectedItem(int role = RUI_APPLICATION_GLOBAL) const;
|
||||
RiuSelectionItem* selectedItem( int role = RUI_APPLICATION_GLOBAL ) const;
|
||||
// PdmUiItem* selectedItem(int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
|
||||
|
||||
// Append item to selected items
|
||||
// SelectionManager takes ownership of the item
|
||||
void appendItemToSelection(RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL);
|
||||
void appendItemToSelection( RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL );
|
||||
|
||||
// Set one selected item
|
||||
// SelectionManager takes ownership of the item
|
||||
void setSelectedItem(RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL);
|
||||
void setSelectedItem( RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL );
|
||||
|
||||
// Deletes all items in the SelectionManager
|
||||
void deleteAllItems(int role = RUI_APPLICATION_GLOBAL);
|
||||
void deleteAllItems( int role = RUI_APPLICATION_GLOBAL );
|
||||
|
||||
bool isEmpty(int role = RUI_APPLICATION_GLOBAL) const;
|
||||
bool isEmpty( int role = RUI_APPLICATION_GLOBAL ) const;
|
||||
|
||||
private:
|
||||
Riu3dSelectionManager();
|
||||
~Riu3dSelectionManager();
|
||||
Riu3dSelectionManager(const Riu3dSelectionManager&) = delete;
|
||||
Riu3dSelectionManager( const Riu3dSelectionManager& ) = delete;
|
||||
|
||||
void deleteAllItemsFromSelection(int role);
|
||||
void deleteAllItemsFromSelection( int role );
|
||||
|
||||
private:
|
||||
std::vector< std::vector<RiuSelectionItem*> > m_selection;
|
||||
std::vector<std::vector<RiuSelectionItem*>> m_selection;
|
||||
|
||||
RiuSelectionChangedHandler* m_notificationCenter;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuSelectionItem
|
||||
@@ -118,29 +115,28 @@ public:
|
||||
|
||||
public:
|
||||
RiuSelectionItem() {}
|
||||
virtual ~RiuSelectionItem() {};
|
||||
virtual ~RiuSelectionItem(){};
|
||||
|
||||
virtual RiuSelectionType type() const = 0;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuEclipseSelectionItem : public RiuSelectionItem
|
||||
{
|
||||
public:
|
||||
explicit RiuEclipseSelectionItem(RimEclipseView* view,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
size_t nncIndex,
|
||||
cvf::Color3f color,
|
||||
cvf::StructGridInterface::FaceType face,
|
||||
const cvf::Vec3d& localIntersectionPointInDisplay);
|
||||
|
||||
~RiuEclipseSelectionItem() override {};
|
||||
explicit RiuEclipseSelectionItem( RimEclipseView* view,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
size_t nncIndex,
|
||||
cvf::Color3f color,
|
||||
cvf::StructGridInterface::FaceType face,
|
||||
const cvf::Vec3d& localIntersectionPointInDisplay );
|
||||
|
||||
~RiuEclipseSelectionItem() override{};
|
||||
|
||||
RiuSelectionType type() const override
|
||||
{
|
||||
@@ -148,39 +144,38 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
caf::PdmPointer<RimEclipseView> m_view;
|
||||
size_t m_gridIndex;
|
||||
size_t m_gridLocalCellIndex;
|
||||
size_t m_nncIndex;
|
||||
cvf::Color3f m_color;
|
||||
caf::PdmPointer<RimEclipseView> m_view;
|
||||
size_t m_gridIndex;
|
||||
size_t m_gridLocalCellIndex;
|
||||
size_t m_nncIndex;
|
||||
cvf::Color3f m_color;
|
||||
cvf::StructGridInterface::FaceType m_face;
|
||||
cvf::Vec3d m_localIntersectionPointInDisplay;
|
||||
cvf::Vec3d m_localIntersectionPointInDisplay;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuGeoMechSelectionItem : public RiuSelectionItem
|
||||
{
|
||||
public:
|
||||
explicit RiuGeoMechSelectionItem(RimGeoMechView* view,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
cvf::Color3f color,
|
||||
int elementFace,
|
||||
const cvf::Vec3d& localIntersectionPointInDisplay);
|
||||
explicit RiuGeoMechSelectionItem( RimGeoMechView* view,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
cvf::Color3f color,
|
||||
int elementFace,
|
||||
const cvf::Vec3d& localIntersectionPointInDisplay );
|
||||
|
||||
explicit RiuGeoMechSelectionItem(RimGeoMechView* view,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
cvf::Color3f color,
|
||||
int elementFace,
|
||||
const cvf::Vec3d& localIntersectionPointInDisplay,
|
||||
const std::array<cvf::Vec3f, 3>& intersectionTriangle );
|
||||
~RiuGeoMechSelectionItem() override {};
|
||||
explicit RiuGeoMechSelectionItem( RimGeoMechView* view,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
cvf::Color3f color,
|
||||
int elementFace,
|
||||
const cvf::Vec3d& localIntersectionPointInDisplay,
|
||||
const std::array<cvf::Vec3f, 3>& intersectionTriangle );
|
||||
~RiuGeoMechSelectionItem() override{};
|
||||
|
||||
RiuSelectionType type() const override
|
||||
{
|
||||
@@ -189,25 +184,24 @@ public:
|
||||
|
||||
public:
|
||||
caf::PdmPointer<RimGeoMechView> m_view;
|
||||
size_t m_gridIndex;
|
||||
size_t m_cellIndex;
|
||||
cvf::Color3f m_color;
|
||||
int m_elementFace;
|
||||
bool m_hasIntersectionTriangle;
|
||||
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
||||
cvf::Vec3d m_localIntersectionPointInDisplay;
|
||||
size_t m_gridIndex;
|
||||
size_t m_cellIndex;
|
||||
cvf::Color3f m_color;
|
||||
int m_elementFace;
|
||||
bool m_hasIntersectionTriangle;
|
||||
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
||||
cvf::Vec3d m_localIntersectionPointInDisplay;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class Riu2dIntersectionSelectionItem : public RiuSelectionItem
|
||||
{
|
||||
public:
|
||||
explicit Riu2dIntersectionSelectionItem(Rim2dIntersectionView* view, RiuSelectionItem *selItem);
|
||||
explicit Riu2dIntersectionSelectionItem( Rim2dIntersectionView* view, RiuSelectionItem* selItem );
|
||||
|
||||
~Riu2dIntersectionSelectionItem() override;
|
||||
|
||||
@@ -218,30 +212,29 @@ public:
|
||||
|
||||
public:
|
||||
caf::PdmPointer<Rim2dIntersectionView> view() const;
|
||||
RiuEclipseSelectionItem* eclipseSelectionItem() const;
|
||||
RiuGeoMechSelectionItem* geoMechSelectionItem() const;
|
||||
RiuEclipseSelectionItem* eclipseSelectionItem() const;
|
||||
RiuGeoMechSelectionItem* geoMechSelectionItem() const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<Rim2dIntersectionView> m_view;
|
||||
RiuEclipseSelectionItem* m_eclipseSelItem;
|
||||
RiuGeoMechSelectionItem* m_geoMechSelItem;
|
||||
RiuEclipseSelectionItem* m_eclipseSelItem;
|
||||
RiuGeoMechSelectionItem* m_geoMechSelItem;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuWellPathSelectionItem : public RiuSelectionItem
|
||||
{
|
||||
public:
|
||||
explicit RiuWellPathSelectionItem(const RivWellPathSourceInfo* wellPathSourceInfo,
|
||||
const cvf::Vec3d& pipeCenterLineIntersectionInDomainCoords,
|
||||
double measuredDepth,
|
||||
RimWellPathComponentInterface* wellPathComponent = nullptr);
|
||||
explicit RiuWellPathSelectionItem( const RivWellPathSourceInfo* wellPathSourceInfo,
|
||||
const cvf::Vec3d& pipeCenterLineIntersectionInDomainCoords,
|
||||
double measuredDepth,
|
||||
RimWellPathComponentInterface* wellPathComponent = nullptr );
|
||||
|
||||
~RiuWellPathSelectionItem() override {};
|
||||
~RiuWellPathSelectionItem() override{};
|
||||
|
||||
RiuSelectionType type() const override
|
||||
{
|
||||
@@ -255,20 +248,17 @@ public:
|
||||
RimWellPathComponentInterface* m_wellPathComponent;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuSimWellSelectionItem : public RiuSelectionItem
|
||||
{
|
||||
public:
|
||||
explicit RiuSimWellSelectionItem(RimSimWellInView* simwell, cvf::Vec3d domainCoord, size_t branchIndex);
|
||||
explicit RiuSimWellSelectionItem( RimSimWellInView* simwell, cvf::Vec3d domainCoord, size_t branchIndex );
|
||||
|
||||
|
||||
~RiuSimWellSelectionItem() override {};
|
||||
~RiuSimWellSelectionItem() override{};
|
||||
|
||||
RiuSelectionType type() const override
|
||||
{
|
||||
@@ -281,18 +271,17 @@ public:
|
||||
size_t m_branchIndex;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuGeneralSelectionItem : public RiuSelectionItem
|
||||
{
|
||||
public:
|
||||
RiuGeneralSelectionItem(caf::PdmObject* object);
|
||||
RiuGeneralSelectionItem( caf::PdmObject* object );
|
||||
|
||||
~RiuGeneralSelectionItem() override {};
|
||||
~RiuGeneralSelectionItem() override{};
|
||||
|
||||
RiuSelectionType type() const override
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user