-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1040 Established basis for fracture visualization
- Loading branch information
Showing
17 changed files
with
491 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
ApplicationCode/ModelVisualization/RivReservoirFracturesPartMgr.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
} | ||
|
48 changes: 48 additions & 0 deletions
48
ApplicationCode/ModelVisualization/RivReservoirFracturesPartMgr.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 112 additions & 0 deletions
112
ApplicationCode/ModelVisualization/RivWellFracturesPartMgr.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 57 additions & 0 deletions
57
ApplicationCode/ModelVisualization/RivWellFracturesPartMgr.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.