mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2523 Mohr circle: Remove colors from circles
This commit is contained in:
parent
4f8c585be7
commit
2d931a81f5
@ -497,22 +497,6 @@ const caf::ColorTable& RiaColorTables::timestepsPaletteColors()
|
|||||||
return colorTable;
|
return colorTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
const caf::ColorTable& RiaColorTables::mohrsCirclePaletteColors()
|
|
||||||
{
|
|
||||||
static std::vector<cvf::Color3ub> colors{
|
|
||||||
cvf::Color3ub(202, 0, 0), // Red
|
|
||||||
cvf::Color3ub(0, 112, 136), // Dark Green-Blue
|
|
||||||
cvf::Color3ub(56, 56, 255), // Vivid Blue
|
|
||||||
};
|
|
||||||
|
|
||||||
static caf::ColorTable colorTable = caf::ColorTable(colors);
|
|
||||||
|
|
||||||
return colorTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -53,7 +53,6 @@ public:
|
|||||||
static const caf::ColorTable& wellLogPlotPaletteColors();
|
static const caf::ColorTable& wellLogPlotPaletteColors();
|
||||||
static const caf::ColorTable& selectionPaletteColors();
|
static const caf::ColorTable& selectionPaletteColors();
|
||||||
static const caf::ColorTable& timestepsPaletteColors();
|
static const caf::ColorTable& timestepsPaletteColors();
|
||||||
static const caf::ColorTable& mohrsCirclePaletteColors();
|
|
||||||
|
|
||||||
static cvf::Color3f undefinedCellColor();
|
static cvf::Color3f undefinedCellColor();
|
||||||
static cvf::Color3f perforationLengthColor();
|
static cvf::Color3f perforationLengthColor();
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
#include "RiuSelectionManager.h"
|
#include "RiuSelectionManager.h"
|
||||||
#include "RiuSummaryQwtPlot.h"
|
#include "RiuSummaryQwtPlot.h"
|
||||||
|
|
||||||
#include "RiaColorTables.h"
|
|
||||||
|
|
||||||
#include "RigFemPart.h"
|
#include "RigFemPart.h"
|
||||||
#include "RigFemPartCollection.h"
|
#include "RigFemPartCollection.h"
|
||||||
#include "RigFemPartGrid.h"
|
#include "RigFemPartGrid.h"
|
||||||
@ -172,18 +170,14 @@ void RiuMohrsCirclePlot::redrawCircles()
|
|||||||
deleteCircles();
|
deleteCircles();
|
||||||
createMohrCircles();
|
createMohrCircles();
|
||||||
|
|
||||||
caf::ColorTable colors = RiaColorTables::mohrsCirclePaletteColors();
|
for (const MohrCircle& circle : m_mohrCircles)
|
||||||
|
|
||||||
for (size_t i = 0; i < m_mohrCircles.size(); i++)
|
|
||||||
{
|
{
|
||||||
MohrCircle* circle = &m_mohrCircles[i];
|
|
||||||
QwtPlotShapeItem* plotItem = new QwtPlotShapeItem("Circle");
|
QwtPlotShapeItem* plotItem = new QwtPlotShapeItem("Circle");
|
||||||
|
|
||||||
QPainterPath* circleDrawing = new QPainterPath();
|
QPainterPath* circleDrawing = new QPainterPath();
|
||||||
QPointF center(circle->centerX, 0);
|
QPointF center(circle.centerX, 0);
|
||||||
circleDrawing->addEllipse(center, circle->radius, circle->radius);
|
circleDrawing->addEllipse(center, circle.radius, circle.radius);
|
||||||
|
|
||||||
plotItem->setPen(QPen(colors.cycledQColor(i)));
|
|
||||||
plotItem->setShape(*circleDrawing);
|
plotItem->setShape(*circleDrawing);
|
||||||
plotItem->setRenderHint(QwtPlotItem::RenderAntialiased, true);
|
plotItem->setRenderHint(QwtPlotItem::RenderAntialiased, true);
|
||||||
plotItem->attach(this);
|
plotItem->attach(this);
|
||||||
@ -294,9 +288,10 @@ void RiuMohrsCirclePlot::addInfoLabel()
|
|||||||
|
|
||||||
QString textBuilder;
|
QString textBuilder;
|
||||||
|
|
||||||
textBuilder.append(QString("<b>Factor of Safety</b>: %1<br>").arg("Coming soon"));
|
|
||||||
textBuilder.append(QString("<b>Friction Angle</b>: %1<br>").arg(m_frictionAngle));
|
textBuilder.append(QString("<b>Friction Angle</b>: %1<br>").arg(m_frictionAngle));
|
||||||
textBuilder.append(QString("<b>Cohesion</b>: %1<br>").arg(m_cohesion));
|
textBuilder.append(QString("<b>Cohesion</b>: %1<br><br>").arg(m_cohesion));
|
||||||
|
|
||||||
|
textBuilder.append(QString("<b>Factor of Safety</b>: %1<br>").arg("Coming soon"));
|
||||||
textBuilder.append(QString("<b>σ<sub>1</sub></b>: %1<br>").arg(m_principal1));
|
textBuilder.append(QString("<b>σ<sub>1</sub></b>: %1<br>").arg(m_principal1));
|
||||||
textBuilder.append(QString("<b>σ<sub>2</sub></b>: %1<br>").arg(m_principal2));
|
textBuilder.append(QString("<b>σ<sub>2</sub></b>: %1<br>").arg(m_principal2));
|
||||||
textBuilder.append(QString("<b>σ<sub>3</sub></b>: %1<br>").arg(m_principal3));
|
textBuilder.append(QString("<b>σ<sub>3</sub></b>: %1<br>").arg(m_principal3));
|
||||||
@ -398,7 +393,7 @@ void RiuMohrsCirclePlot::setDefaults()
|
|||||||
m_cohesion = HUGE_VAL;
|
m_cohesion = HUGE_VAL;
|
||||||
m_frictionAngle = HUGE_VAL;
|
m_frictionAngle = HUGE_VAL;
|
||||||
|
|
||||||
m_factorOfSafety = 0;
|
m_factorOfSafety = HUGE_VAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -406,15 +401,12 @@ void RiuMohrsCirclePlot::setDefaults()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::createMohrCircles()
|
void RiuMohrsCirclePlot::createMohrCircles()
|
||||||
{
|
{
|
||||||
m_mohrCircles[0].component = 2;
|
|
||||||
m_mohrCircles[0].radius = (m_principal1 - m_principal3) / 2.0;
|
m_mohrCircles[0].radius = (m_principal1 - m_principal3) / 2.0;
|
||||||
m_mohrCircles[0].centerX = (m_principal1 + m_principal3) / 2.0;
|
m_mohrCircles[0].centerX = (m_principal1 + m_principal3) / 2.0;
|
||||||
|
|
||||||
m_mohrCircles[1].component = 1;
|
|
||||||
m_mohrCircles[1].radius = (m_principal2 - m_principal3) / 2.0;
|
m_mohrCircles[1].radius = (m_principal2 - m_principal3) / 2.0;
|
||||||
m_mohrCircles[1].centerX = (m_principal2 + m_principal3) / 2.0;
|
m_mohrCircles[1].centerX = (m_principal2 + m_principal3) / 2.0;
|
||||||
|
|
||||||
m_mohrCircles[2].component = 3;
|
|
||||||
m_mohrCircles[2].radius = (m_principal1 - m_principal2) / 2.0;
|
m_mohrCircles[2].radius = (m_principal1 - m_principal2) / 2.0;
|
||||||
m_mohrCircles[2].centerX = (m_principal1 + m_principal2) / 2.0;
|
m_mohrCircles[2].centerX = (m_principal1 + m_principal2) / 2.0;
|
||||||
}
|
}
|
||||||
|
@ -53,10 +53,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
struct MohrCircle
|
struct MohrCircle
|
||||||
{
|
{
|
||||||
MohrCircle(size_t component, double radius, double centerX)
|
MohrCircle(double radius, double centerX)
|
||||||
: component(component), radius(radius), centerX(centerX) {}
|
: radius(radius), centerX(centerX) {}
|
||||||
MohrCircle() {};
|
MohrCircle() {};
|
||||||
size_t component; //1, 2 or 3
|
|
||||||
double radius;
|
double radius;
|
||||||
double centerX;
|
double centerX;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user