mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1040 Established basis for fracture visualization
This commit is contained in:
@@ -17,6 +17,7 @@ ${CEE_CURRENT_LIST_DIR}RivReservoirViewPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivPipeGeometryGenerator.h
|
||||
${CEE_CURRENT_LIST_DIR}RivReservoirFaultsPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivReservoirPipesPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivReservoirFracturesPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivSourceInfo.h
|
||||
${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.h
|
||||
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.h
|
||||
@@ -36,6 +37,7 @@ ${CEE_CURRENT_LIST_DIR}RivPipeQuadToSegmentMapper.h
|
||||
${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.h
|
||||
${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.h
|
||||
${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivWellFracturesPartMgr.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -51,6 +53,7 @@ ${CEE_CURRENT_LIST_DIR}RivReservoirPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivReservoirViewPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivPipeGeometryGenerator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivReservoirPipesPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivReservoirFracturesPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivSourceInfo.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.cpp
|
||||
@@ -68,6 +71,7 @@ ${CEE_CURRENT_LIST_DIR}RivPipeQuadToSegmentMapper.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivWellFracturesPartMgr.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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 "RivReservoirFracturesPartMgr.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimEclipseWell.h"
|
||||
|
||||
#include "RivWellFracturesPartMgr.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivReservoirFracturesPartMgr::RivReservoirFracturesPartMgr(RimEclipseView* reservoirView)
|
||||
{
|
||||
m_reservoirView = reservoirView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivReservoirFracturesPartMgr::~RivReservoirFracturesPartMgr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirFracturesPartMgr::clearGeometryCache()
|
||||
{
|
||||
m_wellFracturesPartMgrs.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirFracturesPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex)
|
||||
{
|
||||
// if (m_reservoirView->wellCollection()->wellSphereVisibility == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF) return;
|
||||
|
||||
if (!m_reservoirView->wellCollection()->isActive()) return;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wells.size() != m_wellFracturesPartMgrs.size())
|
||||
{
|
||||
clearGeometryCache();
|
||||
|
||||
for (RimEclipseWell* rimWell : m_reservoirView->wellCollection()->wells())
|
||||
{
|
||||
RivWellFracturesPartMgr* wppmgr = new RivWellFracturesPartMgr(rimWell);
|
||||
m_wellFracturesPartMgrs.push_back(wppmgr);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_wellFracturesPartMgrs.size(); i++)
|
||||
{
|
||||
// if (m_reservoirView->wellCollection()->wells[i]->isWellSpheresVisible(frameIndex))
|
||||
{
|
||||
m_wellFracturesPartMgrs.at(i)->appendDynamicGeometryPartsToModel(model, frameIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// Well path fractures
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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 "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfCollection.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class ModelBasicList;
|
||||
}
|
||||
|
||||
class RimEclipseView;
|
||||
class RivWellFracturesPartMgr;
|
||||
|
||||
class RivReservoirFracturesPartMgr : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RivReservoirFracturesPartMgr(RimEclipseView* reservoirView);
|
||||
~RivReservoirFracturesPartMgr();
|
||||
|
||||
void clearGeometryCache();
|
||||
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
||||
cvf::Collection< RivWellFracturesPartMgr > m_wellFracturesPartMgrs;
|
||||
};
|
||||
112
ApplicationCode/ModelVisualization/RivWellFracturesPartMgr.cpp
Normal file
112
ApplicationCode/ModelVisualization/RivWellFracturesPartMgr.cpp
Normal file
@@ -0,0 +1,112 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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 "RivWellFracturesPartMgr.h"
|
||||
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimFracture.h"
|
||||
|
||||
#include "cafEffectGenerator.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfPrimitiveSet.h"
|
||||
#include "cvfPrimitiveSetIndexedUInt.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivWellFracturesPartMgr::RivWellFracturesPartMgr(RimEclipseWell* well)
|
||||
{
|
||||
m_rimWell = well;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivWellFracturesPartMgr::~RivWellFracturesPartMgr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellFracturesPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex)
|
||||
{
|
||||
if (!m_rimWell) return;
|
||||
|
||||
std::vector<RimFracture*> fractures;
|
||||
m_rimWell->descendantsIncludingThisOfType(fractures);
|
||||
|
||||
for (RimFracture* fracture : fractures)
|
||||
{
|
||||
if (!fracture->hasValidGeometry())
|
||||
{
|
||||
fracture->computeGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
appendFracturePartsToModel(fractures, model);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellFracturesPartMgr::appendFracturePartsToModel(std::vector<RimFracture*> fractures, cvf::ModelBasicList* model)
|
||||
{
|
||||
for (RimFracture* fracture : fractures)
|
||||
{
|
||||
if (fracture->hasValidGeometry())
|
||||
{
|
||||
const std::vector<cvf::Vec3f>& nodeCoords = fracture->nodeCoords();
|
||||
const std::vector<cvf::uint>& polygonIndices = fracture->polygonIndices();
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> geo = createGeo(polygonIndices, nodeCoords);
|
||||
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable(geo.p());
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(cvf::Color3f(cvf::Color3::BROWN), 0.5), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
|
||||
model->addPart(part.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivWellFracturesPartMgr::createGeo(const std::vector<cvf::uint>& polygonIndices, const std::vector<cvf::Vec3f>& nodeCoords)
|
||||
{
|
||||
cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;
|
||||
|
||||
cvf::ref<cvf::UIntArray> indices = new cvf::UIntArray(polygonIndices);
|
||||
cvf::ref<cvf::Vec3fArray> vertices = new cvf::Vec3fArray(nodeCoords);
|
||||
|
||||
geo->setVertexArray(vertices.p());
|
||||
geo->addPrimitiveSet(new cvf::PrimitiveSetIndexedUInt(cvf::PT_TRIANGLES, indices.p()));
|
||||
|
||||
return geo;
|
||||
}
|
||||
|
||||
57
ApplicationCode/ModelVisualization/RivWellFracturesPartMgr.h
Normal file
57
ApplicationCode/ModelVisualization/RivWellFracturesPartMgr.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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 "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class ModelBasicList;
|
||||
class DrawableGeo;
|
||||
}
|
||||
|
||||
class RimEclipseWell;
|
||||
class RimFracture;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RivWellFracturesPartMgr : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RivWellFracturesPartMgr(RimEclipseWell* well);
|
||||
~RivWellFracturesPartMgr();
|
||||
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
|
||||
|
||||
static void appendFracturePartsToModel(std::vector<RimFracture*> fractures, cvf::ModelBasicList* model);
|
||||
|
||||
private:
|
||||
static cvf::ref<cvf::DrawableGeo> createGeo(const std::vector<cvf::uint>& polygonIndices, const std::vector<cvf::Vec3f>& nodeCoords);
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseWell> m_rimWell;
|
||||
};
|
||||
@@ -19,16 +19,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "RivWellPathPartMgr.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimFracture.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
#include "RivPipeGeometryGenerator.h"
|
||||
#include "RivWellFracturesPartMgr.h"
|
||||
#include "RivWellPathPartMgr.h"
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
|
||||
#include "cafEffectGenerator.h"
|
||||
@@ -81,6 +84,26 @@ RivWellPathPartMgr::~RivWellPathPartMgr()
|
||||
clearAllBranchData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::appendFracturePartsToModel(cvf::ModelBasicList* model)
|
||||
{
|
||||
// Append well path fractures
|
||||
std::vector<RimFracture*> fractures;
|
||||
for (RimWellPathFracture* f : m_rimWellPath->fractureCollection->fractures)
|
||||
{
|
||||
if (!f->hasValidGeometry())
|
||||
{
|
||||
f->computeGeometry();
|
||||
}
|
||||
|
||||
fractures.push_back(f);
|
||||
}
|
||||
|
||||
RivWellFracturesPartMgr::appendFracturePartsToModel(fractures, model);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -265,6 +288,8 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
|
||||
{
|
||||
model->addPart(m_wellLabelPart.p());
|
||||
}
|
||||
|
||||
appendFracturePartsToModel(model);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -52,6 +52,9 @@ public:
|
||||
|
||||
size_t segmentIndexFromTriangleIndex(size_t triangleIndex);
|
||||
|
||||
private:
|
||||
void appendFracturePartsToModel(cvf::ModelBasicList* model);
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimWellPath> m_rimWellPath;
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "RiuSelectionManager.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "RivReservoirFracturesPartMgr.h"
|
||||
#include "RivReservoirPipesPartMgr.h"
|
||||
#include "RivReservoirWellSpheresPartMgr.h"
|
||||
#include "RivSingleCellPartGenerator.h"
|
||||
@@ -134,6 +135,7 @@ RimEclipseView::RimEclipseView()
|
||||
m_reservoirGridPartManager = new RivReservoirViewPartMgr(this);
|
||||
m_pipesPartManager = new RivReservoirPipesPartMgr(this);
|
||||
m_wellSpheresPartManager = new RivReservoirWellSpheresPartMgr(this);
|
||||
m_simWellFracturesPartManager = new RivReservoirFracturesPartMgr(this);
|
||||
|
||||
m_reservoir = NULL;
|
||||
}
|
||||
@@ -666,6 +668,7 @@ void RimEclipseView::updateCurrentTimeStep()
|
||||
|
||||
m_pipesPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
m_wellSpheresPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
m_simWellFracturesPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
|
||||
wellPipeModelBasicList->updateBoundingBoxesRecursive();
|
||||
|
||||
@@ -900,6 +903,7 @@ void RimEclipseView::schedulePipeGeometryRegen()
|
||||
{
|
||||
m_pipesPartManager->scheduleGeometryRegen();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
m_simWellFracturesPartManager->clearGeometryCache();
|
||||
}
|
||||
|
||||
|
||||
@@ -1353,6 +1357,7 @@ void RimEclipseView::updateDisplayModelForWellResults()
|
||||
m_reservoirGridPartManager->clearGeometryCache();
|
||||
m_pipesPartManager->clearGeometryCache();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
m_simWellFracturesPartManager->clearGeometryCache();
|
||||
|
||||
syncronizeWellsWithResults();
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ class RiuViewer;
|
||||
class RivReservoirPipesPartMgr;
|
||||
class RivReservoirWellSpheresPartMgr;
|
||||
class RivIntersectionPartMgr;
|
||||
class RivReservoirFracturesPartMgr;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@@ -180,6 +181,7 @@ private:
|
||||
cvf::ref<RivReservoirViewPartMgr> m_reservoirGridPartManager;
|
||||
cvf::ref<RivReservoirPipesPartMgr> m_pipesPartManager;
|
||||
cvf::ref<RivReservoirWellSpheresPartMgr> m_wellSpheresPartManager;
|
||||
cvf::ref<RivReservoirFracturesPartMgr> m_simWellFracturesPartManager;
|
||||
|
||||
std::vector<RivCellSetEnum> m_visibleGridParts;
|
||||
};
|
||||
|
||||
@@ -18,10 +18,14 @@
|
||||
|
||||
#include "RimFracture.h"
|
||||
|
||||
#include "RigFracture.h"
|
||||
#include "RigTesselatorTools.h"
|
||||
#include "RimFractureDefinition.h"
|
||||
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimFracture, "Fracture");
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimFracture, "Fracture");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -30,6 +34,7 @@ RimFracture::RimFracture(void)
|
||||
{
|
||||
CAF_PDM_InitObject("Fracture", "", "", "");
|
||||
|
||||
m_rigFracture = new RigFracture;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -39,3 +44,53 @@ RimFracture::~RimFracture()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::uint>& RimFracture::polygonIndices() const
|
||||
{
|
||||
return m_rigFracture->polygonIndices();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::Vec3f>& RimFracture::nodeCoords() const
|
||||
{
|
||||
return m_rigFracture->nodeCoords();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFracture::computeGeometry()
|
||||
{
|
||||
std::vector<cvf::Vec3f> nodeCoords;
|
||||
std::vector<cvf::uint> polygonIndices;
|
||||
|
||||
cvf::Vec3d center = centerPointForFracture();
|
||||
RimFractureDefinition* fractureDef = attachedFractureDefinition();
|
||||
if (fractureDef && !center.isUndefined())
|
||||
{
|
||||
RigEllipsisTesselator tesselator(20);
|
||||
|
||||
float a = fractureDef->height / 2.0f;
|
||||
float b = fractureDef->halfLength;
|
||||
|
||||
tesselator.tesselateEllipsis(a, b, &polygonIndices, &nodeCoords);
|
||||
|
||||
}
|
||||
|
||||
// TODO: Modify coords by fracture center and orientation
|
||||
|
||||
m_rigFracture->setGeometry(polygonIndices, nodeCoords);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFracture::hasValidGeometry() const
|
||||
{
|
||||
return (nodeCoords().size() > 0 && polygonIndices().size() > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,16 +20,14 @@
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
/*
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "RimView.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
*/
|
||||
|
||||
|
||||
class RimFractureDefinition;
|
||||
class RigFracture;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
@@ -42,4 +40,15 @@ public:
|
||||
RimFracture(void);
|
||||
virtual ~RimFracture(void);
|
||||
|
||||
virtual cvf::Vec3d centerPointForFracture() = 0;
|
||||
virtual RimFractureDefinition* attachedFractureDefinition() = 0;
|
||||
|
||||
bool hasValidGeometry() const;
|
||||
void computeGeometry();
|
||||
|
||||
const std::vector<cvf::uint>& polygonIndices() const;
|
||||
const std::vector<cvf::Vec3f>& nodeCoords() const;
|
||||
|
||||
private:
|
||||
cvf::ref<RigFracture> m_rigFracture;
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "QToolBox"
|
||||
#include "QList"
|
||||
#include "cvfVector3.h"
|
||||
#include "RigTesselatorTools.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSimWellFracture, "SimWellFracture");
|
||||
@@ -93,6 +94,23 @@ QList<caf::PdmOptionItemInfo> RimSimWellFracture::calculateValueOptions(const ca
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RimSimWellFracture::centerPointForFracture()
|
||||
{
|
||||
// TODO: Find center point of cell
|
||||
return cvf::Vec3d::UNDEFINED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureDefinition* RimSimWellFracture::attachedFractureDefinition()
|
||||
{
|
||||
return fractureDefinition();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -52,6 +52,11 @@ public:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
|
||||
|
||||
// Overrides from RimFracture
|
||||
virtual cvf::Vec3d centerPointForFracture() override;
|
||||
virtual RimFractureDefinition* attachedFractureDefinition() override;
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "QToolBox"
|
||||
#include "QList"
|
||||
#include "cvfVector3.h"
|
||||
#include "RigTesselatorTools.h"
|
||||
|
||||
|
||||
|
||||
@@ -97,6 +98,22 @@ QList<caf::PdmOptionItemInfo> RimWellPathFracture::calculateValueOptions(const c
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RimWellPathFracture::centerPointForFracture()
|
||||
{
|
||||
return positionAtWellpath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureDefinition* RimWellPathFracture::attachedFractureDefinition()
|
||||
{
|
||||
return fractureDefinition();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "RimView.h"
|
||||
#include "cvfVector3.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "RimFracture.h"
|
||||
|
||||
@@ -56,6 +56,9 @@ public:
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
// Overrides from RimFracture
|
||||
virtual cvf::Vec3d centerPointForFracture() override;
|
||||
virtual RimFractureDefinition* attachedFractureDefinition() override;
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
@@ -25,3 +25,29 @@ RigFracture::RigFracture()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFracture::setGeometry(const std::vector<cvf::uint>& polygonIndices, const std::vector<cvf::Vec3f>& nodeCoords)
|
||||
{
|
||||
m_nodeCoords = nodeCoords;
|
||||
m_polygonIndices = polygonIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::uint>& RigFracture::polygonIndices() const
|
||||
{
|
||||
return m_polygonIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::Vec3f>& RigFracture::nodeCoords() const
|
||||
{
|
||||
return m_nodeCoords;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfMath.h"
|
||||
@@ -25,7 +26,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@@ -34,6 +34,13 @@ class RigFracture : public cvf::Object
|
||||
public:
|
||||
RigFracture();
|
||||
|
||||
void setGeometry(const std::vector<cvf::uint>& polygonIndices, const std::vector<cvf::Vec3f>& nodeCoords);
|
||||
|
||||
const std::vector<cvf::uint>& polygonIndices() const;
|
||||
const std::vector<cvf::Vec3f>& nodeCoords() const;
|
||||
|
||||
private:
|
||||
std::vector<cvf::uint> m_polygonIndices;
|
||||
std::vector<cvf::Vec3f> m_nodeCoords;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user