2017-10-23 11:29:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-10-23 11:29: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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-10-23 11:29:23 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-10-23 11:29:23 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-08-05 06:14:58 -05:00
|
|
|
#include "RiaPlotDefines.h"
|
|
|
|
|
2019-09-10 08:21:58 -05:00
|
|
|
#include "cafColorTable.h"
|
|
|
|
|
2017-10-23 11:29:23 -05:00
|
|
|
#include "qwt_plot_marker.h"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
2022-03-18 07:16:07 -05:00
|
|
|
#include <QColor>
|
2017-11-03 05:36:44 -05:00
|
|
|
#include <QPointer>
|
|
|
|
|
2017-10-23 11:29:23 -05:00
|
|
|
class QString;
|
|
|
|
class QwtPlot;
|
|
|
|
|
|
|
|
class RiuPlotAnnotationTool
|
|
|
|
{
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
RiuPlotAnnotationTool(){};
|
2017-11-03 05:36:44 -05:00
|
|
|
~RiuPlotAnnotationTool();
|
2017-10-23 11:29:23 -05:00
|
|
|
|
2019-11-03 07:08:21 -06:00
|
|
|
void attachNamedRegions( QwtPlot* plot,
|
|
|
|
const std::vector<QString>& names,
|
2022-08-05 06:14:58 -05:00
|
|
|
RiaDefines::Orientation orientation,
|
|
|
|
const std::vector<std::pair<double, double>>& regionRanges,
|
|
|
|
RiaDefines::RegionDisplay regionDisplay,
|
2019-11-03 07:08:21 -06:00
|
|
|
const caf::ColorTable& colorTable,
|
|
|
|
int shadingAlphaByte,
|
2022-08-05 06:14:58 -05:00
|
|
|
bool showNames = true,
|
|
|
|
RiaDefines::TrackSpan trackSpan = RiaDefines::TrackSpan::FULL_WIDTH,
|
|
|
|
const std::vector<Qt::BrushStyle>& brushStyles = {},
|
|
|
|
int fontSize = 0 );
|
2019-11-03 07:08:21 -06:00
|
|
|
void attachWellPicks( QwtPlot* plot, const std::vector<QString>& names, const std::vector<double>& yPositions );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2022-08-05 06:14:58 -05:00
|
|
|
void attachAnnotationLine( QwtPlot* plot,
|
|
|
|
const QColor& color,
|
|
|
|
const QString& annotationText,
|
|
|
|
const double position,
|
|
|
|
RiaDefines::Orientation orientation );
|
2020-12-07 09:47:34 -06:00
|
|
|
|
2022-08-05 06:14:58 -05:00
|
|
|
void attachAnnotationRange( QwtPlot* plot,
|
|
|
|
const QColor& color,
|
|
|
|
const QString& annotationText,
|
|
|
|
const double rangeStart,
|
|
|
|
const double rangeEnd,
|
|
|
|
RiaDefines::Orientation orientation );
|
2020-12-07 09:47:34 -06:00
|
|
|
|
|
|
|
void horizontalRange( const QString& name,
|
|
|
|
const std::pair<double, double> yRange,
|
|
|
|
const QColor& color = QColor( 0, 0, 100 ),
|
|
|
|
const QColor& textColor = QColor( 0, 0, 100 ),
|
|
|
|
Qt::Alignment horizontalAlignment = Qt::AlignRight );
|
|
|
|
|
|
|
|
void verticalRange( const QString& name,
|
|
|
|
const std::pair<double, double> xRange,
|
|
|
|
const QColor& color = QColor( 0, 0, 100 ),
|
|
|
|
const QColor& textColor = QColor( 0, 0, 100 ),
|
|
|
|
Qt::Alignment horizontalAlignment = Qt::AlignRight );
|
2019-03-22 09:11:56 -05:00
|
|
|
|
2017-10-23 11:29:23 -05:00
|
|
|
void detachAllAnnotations();
|
|
|
|
|
2017-12-05 05:56:13 -06:00
|
|
|
private:
|
2022-08-05 06:14:58 -05:00
|
|
|
static Qt::Alignment trackTextAlignment( RiaDefines::TrackSpan trackSpan );
|
|
|
|
|
|
|
|
static void setLineProperties( QwtPlotMarker* line,
|
|
|
|
const QString& name,
|
|
|
|
RiaDefines::Orientation orientation,
|
|
|
|
double linePosition,
|
|
|
|
Qt::PenStyle lineStyle = Qt::DashLine,
|
|
|
|
const QColor& color = QColor( 0, 0, 100 ),
|
|
|
|
const QColor& textColor = QColor( 0, 0, 100 ),
|
|
|
|
Qt::Alignment horizontalAlignment = Qt::AlignRight,
|
|
|
|
int fontSize = 0 );
|
2020-12-07 09:47:34 -06:00
|
|
|
|
2017-10-23 11:29:23 -05:00
|
|
|
private:
|
2019-09-10 06:23:29 -05:00
|
|
|
QPointer<QwtPlot> m_plot;
|
2022-08-05 06:14:58 -05:00
|
|
|
std::vector<QwtPlotItem*> m_plotItems;
|
2017-10-23 11:29:23 -05:00
|
|
|
};
|