(#266) Added geometry for grid box faces

Added legend lines and text
This commit is contained in:
Magne Sjaastad committed 2015-11-17 13:11:54 +01:00
1 parent 83d1c0c411
commit 7ff7f42adc
12 files changed
+955 -19

No files matched your search

@@ -28,6 +28,8 @@
#include "RimViewController.h"
#include "RimViewLinker.h"
#include "RivGridBoxGenerator.h"
#include "RiuCadNavigation.h"
#include "RiuGeoQuestNavigation.h"
#include "RiuRmsNavigation.h"
@@ -160,6 +162,9 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
// Setting this policy will make sure the handling is not deferred to the widget's parent,
// which solves the problem
setContextMenuPolicy(Qt::PreventContextMenu);
m_showGridBox = true;
m_gridBoxGenerator = new RivGridBoxGenerator;
}
@@ -179,6 +184,7 @@ RiuViewer::~RiuViewer()
delete m_animationProgress;
delete m_histogramWidget;
delete m_progressBarStyle;
delete m_gridBoxGenerator;
}
@@ -502,6 +508,11 @@ void RiuViewer::navigationPolicyUpdate()
{
viewLinker->updateCamera(m_reservoirView);
}
if (m_showGridBox)
{
m_gridBoxGenerator->updateFromCamera(mainCamera());
}
}
}
@@ -525,3 +536,25 @@ RimView* RiuViewer::ownerReservoirView()
{
return m_reservoirView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showGridBox(bool enable)
{
m_showGridBox = enable;
if (!enable)
{
currentScene()->removeModel(m_gridBoxGenerator->model());
}
else
{
m_gridBoxGenerator->setBoundingBox(mainScene()->boundingBox());
// m_gridBoxGenerator->setTransform();
m_gridBoxGenerator->updateFromCamera(mainCamera());
m_gridBoxGenerator->createGridBoxParts();
currentScene()->addModel(m_gridBoxGenerator->model());
}
}
+11 -4
View File
@@ -29,11 +29,13 @@
#include "cvfStructGrid.h"
class RimView;
class RiuSimpleHistogramWidget;
class RiuViewerCommands;
class RivGridBoxGenerator;
class QCDEStyle;
class QLabel;
class QProgressBar;
class RiuSimpleHistogramWidget;
class QCDEStyle;
class RiuViewerCommands;
namespace cvf
{
@@ -67,6 +69,8 @@ public:
void setHistogram(double min, double max, const std::vector<size_t>& histogram);
void setHistogramPercentiles(double pmin, double pmax, double mean);
void showGridBox(bool enable);
void showAnimationProgress(bool enable);
void removeAllColorLegends();
@@ -106,6 +110,9 @@ private:
caf::PdmPointer<RimView> m_reservoirView;
QPoint m_lastMousePressPosition;
RiuViewerCommands * m_viewerCommands;
RiuViewerCommands* m_viewerCommands;
bool m_showGridBox;
RivGridBoxGenerator* m_gridBoxGenerator;
};