2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -05:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
|
|
|
#include "cafViewer.h"
|
|
|
|
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
|
|
|
#include "cafMouseState.h"
|
2014-07-25 07:48:37 -05:00
|
|
|
#include "cvfStructGrid.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-11-27 10:18:30 -06:00
|
|
|
class RicCommandFeature;
|
2015-04-30 03:34:15 -05:00
|
|
|
class RimView;
|
2012-09-11 02:22:36 -05:00
|
|
|
class RiuSimpleHistogramWidget;
|
2015-06-11 04:38:51 -05:00
|
|
|
class RiuViewerCommands;
|
2015-11-12 05:00:51 -06:00
|
|
|
class RivGridBoxGenerator;
|
|
|
|
|
|
|
|
class QCDEStyle;
|
|
|
|
class QLabel;
|
|
|
|
class QProgressBar;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
2015-11-23 06:31:01 -06:00
|
|
|
class Color3f;
|
2015-11-16 07:08:17 -06:00
|
|
|
class Model;
|
2014-04-07 06:18:39 -05:00
|
|
|
class OverlayItem;
|
2015-11-16 07:08:17 -06:00
|
|
|
class Part;
|
2015-11-20 02:12:07 -06:00
|
|
|
class OverlayAxisCross;
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
2013-03-22 11:30:50 -05:00
|
|
|
// RiuViewer
|
2012-05-18 02:45:23 -05:00
|
|
|
//
|
|
|
|
//==================================================================================================
|
2013-03-22 11:17:56 -05:00
|
|
|
class RiuViewer : public caf::Viewer
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuViewer(const QGLFormat& format, QWidget* parent);
|
|
|
|
~RiuViewer();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void setDefaultView();
|
|
|
|
cvf::Vec3d pointOfInterest();
|
|
|
|
void setPointOfInterest(cvf::Vec3d poi);
|
2015-04-30 03:34:15 -05:00
|
|
|
void setOwnerReservoirView(RimView * owner);
|
2015-09-10 01:14:28 -05:00
|
|
|
RimView* ownerReservoirView();
|
2012-05-18 02:45:23 -05:00
|
|
|
void setEnableMask(unsigned int mask);
|
2012-09-11 02:22:36 -05:00
|
|
|
|
|
|
|
void showInfoText(bool enable);
|
|
|
|
void setInfoText(QString text);
|
|
|
|
void showHistogram(bool enable);
|
|
|
|
void setHistogram(double min, double max, const std::vector<size_t>& histogram);
|
2012-10-23 05:08:46 -05:00
|
|
|
void setHistogramPercentiles(double pmin, double pmax, double mean);
|
2012-09-11 02:22:36 -05:00
|
|
|
|
2015-11-16 07:08:17 -06:00
|
|
|
void updateGridBoxData();
|
|
|
|
cvf::Model* gridBoxModel() const;
|
2015-11-12 05:00:51 -06:00
|
|
|
|
2012-09-11 02:22:36 -05:00
|
|
|
void showAnimationProgress(bool enable);
|
2014-04-07 06:18:39 -05:00
|
|
|
|
2014-07-30 03:54:46 -05:00
|
|
|
void removeAllColorLegends();
|
|
|
|
void addColorLegendToBottomLeftCorner(cvf::OverlayItem* legend);
|
2014-04-07 06:18:39 -05:00
|
|
|
|
2015-07-02 05:44:57 -05:00
|
|
|
void updateNavigationPolicy();
|
2015-08-28 14:32:51 -05:00
|
|
|
|
2015-09-01 11:04:35 -05:00
|
|
|
virtual void navigationPolicyUpdate(); // Override of caf::Viewer::navigationPolicyUpdate()
|
2015-08-28 14:32:51 -05:00
|
|
|
|
2015-09-01 10:14:22 -05:00
|
|
|
void setCurrentFrame(int frameIndex);
|
|
|
|
|
2015-11-20 02:12:07 -06:00
|
|
|
void setAxisLabels(const cvf::String& xLabel, const cvf::String& yLabel, const cvf::String& zLabel);
|
|
|
|
|
2016-09-23 09:12:19 -05:00
|
|
|
cvf::Vec3d lastPickPositionInDomainCoords() const;
|
2016-09-27 04:59:06 -05:00
|
|
|
caf::PdmObject* lastPickedObject() const;
|
2016-09-23 09:12:19 -05:00
|
|
|
|
2016-10-17 04:51:25 -05:00
|
|
|
cvf::OverlayItem* pickFixedPositionedLegend(int winPosX, int winPosY);
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
public slots:
|
|
|
|
virtual void slotSetCurrentFrame(int frameIndex);
|
|
|
|
virtual void slotEndAnimation();
|
|
|
|
|
2015-11-16 03:01:50 -06:00
|
|
|
protected:
|
|
|
|
virtual void optimizeClippingPlanes();
|
2016-09-12 04:11:25 -05:00
|
|
|
virtual void resizeGL(int width, int height);
|
2015-11-16 03:01:50 -06:00
|
|
|
|
2015-06-11 04:38:51 -05:00
|
|
|
private:
|
2015-11-23 06:31:01 -06:00
|
|
|
void updateTextAndTickMarkColorForOverlayItems();
|
|
|
|
void updateLegendTextAndTickMarkColor(cvf::OverlayItem* legend);
|
|
|
|
|
|
|
|
cvf::Color3f computeContrastColor() const;
|
|
|
|
|
|
|
|
void updateAxisCrossTextColor();
|
|
|
|
|
2012-09-11 02:22:36 -05:00
|
|
|
void paintOverlayItems(QPainter* painter);
|
2015-06-05 08:17:02 -05:00
|
|
|
|
2015-06-11 04:38:51 -05:00
|
|
|
void mouseReleaseEvent(QMouseEvent* event);
|
2013-04-23 00:29:37 -05:00
|
|
|
void mousePressEvent(QMouseEvent* event);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-11-16 03:01:50 -06:00
|
|
|
private:
|
2015-12-07 02:59:19 -06:00
|
|
|
QLabel* m_infoLabel;
|
|
|
|
QRect m_infoLabelOverlayArea;
|
|
|
|
|
2015-06-24 06:44:42 -05:00
|
|
|
QLabel* m_versionInfoLabel;
|
2015-11-11 10:42:30 -06:00
|
|
|
bool m_showInfoText;
|
2012-09-11 02:22:36 -05:00
|
|
|
|
|
|
|
QProgressBar* m_animationProgress;
|
|
|
|
bool m_showAnimProgress;
|
|
|
|
RiuSimpleHistogramWidget* m_histogramWidget;
|
|
|
|
bool m_showHistogram;
|
|
|
|
|
2012-10-24 04:01:41 -05:00
|
|
|
QCDEStyle* m_progressBarStyle;
|
2012-09-11 02:22:36 -05:00
|
|
|
|
2015-11-20 02:12:07 -06:00
|
|
|
cvf::ref<cvf::OverlayAxisCross> m_axisCross;
|
2014-07-30 03:54:46 -05:00
|
|
|
cvf::Collection<cvf::OverlayItem> m_visibleLegends;
|
2013-02-28 04:58:31 -06:00
|
|
|
|
2015-11-16 00:16:30 -06:00
|
|
|
caf::PdmPointer<RimView> m_rimView;
|
|
|
|
QPoint m_lastMousePressPosition;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-11-16 00:16:30 -06:00
|
|
|
RiuViewerCommands* m_viewerCommands;
|
2015-11-12 05:00:51 -06:00
|
|
|
|
2015-11-16 00:16:30 -06:00
|
|
|
RivGridBoxGenerator* m_gridBoxGenerator;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
2015-06-11 04:38:51 -05:00
|
|
|
|