mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3402 HoloLens : Add visibleParts to RiuViewer
This commit is contained in:
parent
b6e43de923
commit
c9f77bae98
@ -45,7 +45,6 @@
|
||||
#include "cvfRenderState.h"
|
||||
#include "cvfRenderStateTextureBindings.h"
|
||||
#include "cvfRenderState_FF.h"
|
||||
#include "cvfScene.h"
|
||||
#include "cvfTexture.h"
|
||||
#include "cvfTexture2D_FF.h"
|
||||
|
||||
@ -63,13 +62,9 @@ std::vector<VdeExportPart> RicHoloLensExportImpl::partsForExport(const RimGridVi
|
||||
|
||||
if (view.viewer())
|
||||
{
|
||||
cvf::Scene* scene = view.viewer()->currentScene();
|
||||
if (scene)
|
||||
{
|
||||
cvf::Collection<cvf::Part> sceneParts;
|
||||
scene->allParts(&sceneParts);
|
||||
auto visibleParts = view.viewer()->visibleParts();
|
||||
|
||||
for (auto& scenePart : sceneParts)
|
||||
for (auto& scenePart : visibleParts)
|
||||
{
|
||||
if (RicHoloLensExportImpl::isGrid(scenePart.p()))
|
||||
{
|
||||
@ -204,7 +199,6 @@ std::vector<VdeExportPart> RicHoloLensExportImpl::partsForExport(const RimGridVi
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return exportParts;
|
||||
}
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "cvfFont.h"
|
||||
#include "cvfOpenGLResourceManager.h"
|
||||
#include "cvfOverlayAxisCross.h"
|
||||
#include "cvfPartRenderHintCollection.h"
|
||||
#include "cvfRenderQueueSorter.h"
|
||||
#include "cvfRenderSequence.h"
|
||||
#include "cvfRendering.h"
|
||||
@ -921,6 +922,40 @@ void RiuViewer::setCursorPosition(const cvf::Vec3d& domainCoord)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::ref<cvf::Part>> RiuViewer::visibleParts()
|
||||
{
|
||||
std::vector<cvf::ref<cvf::Part>> partsMatchingEnableMask;
|
||||
|
||||
if (m_mainRendering.notNull())
|
||||
{
|
||||
auto enableMask = m_mainRendering->enableMask();
|
||||
cvf::Scene* scene = currentScene();
|
||||
|
||||
for (cvf::uint i = 0; i < scene->modelCount(); i++)
|
||||
{
|
||||
cvf::Model* model = scene->model(i);
|
||||
if (enableMask & model->partEnableMask())
|
||||
{
|
||||
cvf::Collection<cvf::Part> partCollection;
|
||||
model->allParts(&partCollection);
|
||||
|
||||
for (const auto& p : partCollection)
|
||||
{
|
||||
if (enableMask & p->enableMask())
|
||||
{
|
||||
partsMatchingEnableMask.push_back(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return partsMatchingEnableMask;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -116,6 +116,8 @@ public:
|
||||
|
||||
void setCursorPosition(const cvf::Vec3d& domainCoord);
|
||||
|
||||
std::vector<cvf::ref<cvf::Part>> visibleParts();
|
||||
|
||||
public slots:
|
||||
void slotSetCurrentFrame(int frameIndex) override;
|
||||
void slotEndAnimation() override;
|
||||
|
Loading…
Reference in New Issue
Block a user