#1041 - pre-proto - Adding new functions transformMatrix (for calculating transform Matrix for fracture) and getPotentiallyFracturedCells (finding all cells in bounding box for fracture geometry) in RimFracture. Relevant code is updated to use these functions.

This commit is contained in:
astridkbjorke
2017-01-12 12:19:52 +01:00
parent 86d98cb55b
commit 89bf71b664
8 changed files with 68 additions and 57 deletions

View File

@@ -160,32 +160,32 @@ void RimSimWellFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFiel
if (proj) proj->createDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<size_t, size_t>> RimSimWellFracture::getFracturedCells()
{
std::vector<std::pair<size_t, size_t>> cells;
size_t gridindex = 0; //TODO! For now assuming only one grid
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
if (!objHandle) return cells;
RimEclipseView* mainView = nullptr;
objHandle->firstAncestorOrThisOfType(mainView);
if (!mainView) return cells;
const RigMainGrid* mainGrid = mainView->mainGrid();
if (!mainGrid) return cells;
size_t cellIndex = mainGrid->cellIndexFromIJK(m_i - 1, m_j - 1, m_k - 1); // cellIndexFromIJK uses 0-based indexing
cells.push_back(std::make_pair(cellIndex, gridindex));
return cells;
}
// --------------------------------------------------------------------------------------------------
// /
// --------------------------------------------------------------------------------------------------
// std::vector<std::pair<size_t, size_t>> RimSimWellFracture::getFracturedCells()
// {
// std::vector<std::pair<size_t, size_t>> cells;
//
// size_t gridindex = 0; //TODO! For now assuming only one grid
//
//
// caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
// if (!objHandle) return cells;
//
// RimEclipseView* mainView = nullptr;
// objHandle->firstAncestorOrThisOfType(mainView);
// if (!mainView) return cells;
//
// const RigMainGrid* mainGrid = mainView->mainGrid();
// if (!mainGrid) return cells;
//
// size_t cellIndex = mainGrid->cellIndexFromIJK(m_i - 1, m_j - 1, m_k - 1); // cellIndexFromIJK uses 0-based indexing
//
// cells.push_back(std::make_pair(cellIndex, gridindex));
//
// return cells;
// }
//--------------------------------------------------------------------------------------------------
///