Now reading Odb-file and creating display model

Nothing shows up yet, but we're getting there
This commit is contained in:
Jacob Støren
2015-04-27 13:51:22 +02:00
parent ea3d2dc40d
commit 0f3d9ffa60
14 changed files with 327 additions and 8 deletions

View File

@@ -7,11 +7,13 @@ endif()
set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RivFemPartGeometryGenerator.h
${CEE_CURRENT_LIST_DIR}RivFemPartPartMgr.h
${CEE_CURRENT_LIST_DIR}RivGeoMechPartMgr.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RivFemPartGeometryGenerator.cpp
${CEE_CURRENT_LIST_DIR}RivFemPartPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivGeoMechPartMgr.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -156,7 +156,7 @@ void RivFemPartGeometryGenerator::computeArrays()
cvf::Vec3d offset = Vec3d::ZERO; //m_part->displayModelOffset();
const std::vector<cvf::Vec3f>& nodeCoordinates = m_part->nodes().coordinates;
#pragma omp parallel for schedule(dynamic)
//#pragma omp parallel for schedule(dynamic)
for (int elmIdx = 0; elmIdx < static_cast<int>(m_part->elementCount()); elmIdx++)
{
if (m_elmVisibility.isNull() || (*m_elmVisibility)[elmIdx])

View File

@@ -47,7 +47,7 @@ class RigFemPart;
class RivFemPartPartMgr: public cvf::Object
{
public:
RivFemPartPartMgr(const RigFemPart* grid);
RivFemPartPartMgr(const RigFemPart* femPart);
~RivFemPartPartMgr();
void setTransform(cvf::Transform* scaleTransform);
void setCellVisibility(cvf::UByteArray* cellVisibilities );

View File

@@ -0,0 +1,140 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RivGeoMechPartMgr.h"
#include "cvfPart.h"
#include "cvfModelBasicList.h"
#include "RigGeoMechCaseData.h"
#include "RigFemPartCollection.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGeoMechPartMgr::RivGeoMechPartMgr()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGeoMechPartMgr::~RivGeoMechPartMgr()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgr::clearAndSetReservoir(const RigGeoMechCaseData* geoMechCase, RimGeoMechView* geomechView)
{
m_femPartPartMgrs.clear();
if (geoMechCase)
{
const RigFemPartCollection* femParts = geoMechCase->femParts();
for (size_t i = 0; i < femParts->partCount(); ++i)
{
m_femPartPartMgrs.push_back(new RivFemPartPartMgr(femParts->part(i)));
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgr::setTransform(cvf::Transform* scaleTransform)
{
for (size_t i = 0; i < m_femPartPartMgrs.size() ; ++i)
{
m_femPartPartMgrs[i]->setTransform(scaleTransform);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgr::setCellVisibility(size_t gridIndex, cvf::UByteArray* cellVisibilities)
{
CVF_ASSERT(gridIndex < m_femPartPartMgrs.size());
m_femPartPartMgrs[gridIndex]->setCellVisibility(cellVisibilities);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::UByteArray> RivGeoMechPartMgr::cellVisibility(size_t gridIdx)
{
CVF_ASSERT(gridIdx < m_femPartPartMgrs.size());
return m_femPartPartMgrs[gridIdx]->cellVisibility();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgr::updateCellColor(cvf::Color4f color)
{
for (size_t i = 0; i < m_femPartPartMgrs.size() ; ++i)
{
m_femPartPartMgrs[i]->updateCellColor(color);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechResultSlot* cellResultSlot)
{
for (size_t i = 0; i < m_femPartPartMgrs.size() ; ++i)
{
m_femPartPartMgrs[i]->updateCellResultColor(timeStepIndex, cellResultSlot);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgr::appendGridPartsToModel(cvf::ModelBasicList* model)
{
for (size_t i = 0; i < m_femPartPartMgrs.size() ; ++i)
{
m_femPartPartMgrs[i]->appendPartsToModel(model);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgr::appendGridPartsToModel(cvf::ModelBasicList* model, const std::vector<size_t>& gridIndices)
{
for (size_t i = 0; i < gridIndices.size() ; ++i)
{
if (gridIndices[i] < m_femPartPartMgrs.size())
{
m_femPartPartMgrs[gridIndices[i]]->appendPartsToModel(model);
}
}
}

View File

@@ -0,0 +1,66 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// 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 "cvfArray.h"
#include "cvfCollection.h"
#include "RivFemPartPartMgr.h"
namespace cvf
{
class ModelBasicList;
class Transform;
}
class RimGeoMechResultSlot;
class RigGeoMechCaseData;
class RimGeoMechView;
//==================================================================================================
///
/// Class to handle visualization structures that embodies a complete Geo-mech reservoir at a specific
/// time step.
///
//==================================================================================================
class RivGeoMechPartMgr: public cvf::Object
{
public:
RivGeoMechPartMgr();
~RivGeoMechPartMgr();
void clearAndSetReservoir(const RigGeoMechCaseData* geoMechCase, RimGeoMechView* geomechView);
void setTransform(cvf::Transform* scaleTransform);
void setCellVisibility(size_t partIndex, cvf::UByteArray* cellVisibilities );
cvf::ref<cvf::UByteArray>
cellVisibility(size_t partIndex);
void updateCellColor(cvf::Color4f color);
void updateCellResultColor(size_t timeStepIndex, RimGeoMechResultSlot* cellResultSlot);
void appendGridPartsToModel(cvf::ModelBasicList* model, const std::vector<size_t>& partIndices);
void appendGridPartsToModel(cvf::ModelBasicList* model);
private:
cvf::Collection<RivFemPartPartMgr> m_femPartPartMgrs;
};