diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h index 569bb849d0..531cb7ae98 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h @@ -50,7 +50,7 @@ public: int elmId(size_t elementIdx) const { return m_elementId[elementIdx]; } RigElementType elementType(size_t elementIdx) const { return m_elementTypes[elementIdx]; } const int* connectivities(size_t elementIdx) const { return &m_allAlementConnectivities[m_elementConnectivityStartIndices[elementIdx]];} - int elementNodeResultIdx(int elementIdx, int elmLocalNodeIdx) const { return m_elementConnectivityStartIndices[elementIdx];} + size_t elementNodeResultIdx(int elementIdx, int elmLocalNodeIdx) const { return m_elementConnectivityStartIndices[elementIdx] + elmLocalNodeIdx;} RigFemPartNodes& nodes() {return m_nodes;} const RigFemPartNodes& nodes() const {return m_nodes;} diff --git a/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp b/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp index 8d8f41f452..d02a69a6e2 100644 --- a/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp +++ b/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp @@ -170,7 +170,7 @@ void RivFemPartGeometryGenerator::computeArrays() for (int lfIdx = 0; lfIdx < faceCount; ++lfIdx) { int faceNodeCount = 0; - const int* elmLocalFaceIndices = RigFemTypes::elementLocalFaceIndices(eType, lfIdx, &faceNodeCount); + const int* localElmNodeIndicesForFace = RigFemTypes::localElmNodeIndicesForFace(eType, lfIdx, &faceNodeCount); if (faceNodeCount == 4) { #if 0 @@ -183,10 +183,20 @@ void RivFemPartGeometryGenerator::computeArrays() #endif // Needs to get rid of opposite faces - vertices.push_back(nodeCoordinates[ elmNodeIndices[elmLocalFaceIndices[0]] ]); - vertices.push_back(nodeCoordinates[ elmNodeIndices[elmLocalFaceIndices[1]] ]); - vertices.push_back(nodeCoordinates[ elmNodeIndices[elmLocalFaceIndices[2]] ]); - vertices.push_back(nodeCoordinates[ elmNodeIndices[elmLocalFaceIndices[3]] ]); + vertices.push_back(nodeCoordinates[ elmNodeIndices[localElmNodeIndicesForFace[0]] ]); + vertices.push_back(nodeCoordinates[ elmNodeIndices[localElmNodeIndicesForFace[1]] ]); + vertices.push_back(nodeCoordinates[ elmNodeIndices[localElmNodeIndicesForFace[2]] ]); + vertices.push_back(nodeCoordinates[ elmNodeIndices[localElmNodeIndicesForFace[3]] ]); + + m_quadVerticesToNodeIdx.push_back(elmNodeIndices[localElmNodeIndicesForFace[0]]); + m_quadVerticesToNodeIdx.push_back(elmNodeIndices[localElmNodeIndicesForFace[1]]); + m_quadVerticesToNodeIdx.push_back(elmNodeIndices[localElmNodeIndicesForFace[2]]); + m_quadVerticesToNodeIdx.push_back(elmNodeIndices[localElmNodeIndicesForFace[3]]); + + m_quadVerticesToGlobalElmNodeIdx.push_back(m_part->elementNodeResultIdx(elmIdx, localElmNodeIndicesForFace[0])); + m_quadVerticesToGlobalElmNodeIdx.push_back(m_part->elementNodeResultIdx(elmIdx, localElmNodeIndicesForFace[1])); + m_quadVerticesToGlobalElmNodeIdx.push_back(m_part->elementNodeResultIdx(elmIdx, localElmNodeIndicesForFace[2])); + m_quadVerticesToGlobalElmNodeIdx.push_back(m_part->elementNodeResultIdx(elmIdx, localElmNodeIndicesForFace[3])); } else { @@ -204,15 +214,6 @@ void RivFemPartGeometryGenerator::computeArrays() -//-------------------------------------------------------------------------------------------------- -/// Calculates the texture coordinates in a "nearly" one dimentional texture. -/// Undefined values are coded with a y-texturecoordinate value of 1.0 instead of the normal 0.5 -//-------------------------------------------------------------------------------------------------- -void RivFemPartGeometryGenerator::textureCoordinates(Vec2fArray* textureCoords, const RigFemPartScalarDataAccess* resultAccessor, const ScalarMapper* mapper) const -{ - -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h b/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h index 80e56340a4..1814b97c32 100644 --- a/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h +++ b/ApplicationCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h @@ -37,8 +37,6 @@ public: const RigFemPart* activePart() { return m_part.p(); } - void textureCoordinates(cvf::Vec2fArray* textureCoords, const RigFemPartScalarDataAccess* resultAccessor, const cvf::ScalarMapper* mapper) const; - // Generated geometry cvf::ref generateSurface(); cvf::ref createMeshDrawable(); @@ -57,6 +55,8 @@ private: // Created arrays cvf::ref m_quadVertices; //cvf::ref m_triangleVertices; // If needed, we will do it like this, I think + std::vector m_quadVerticesToNodeIdx; + std::vector m_quadVerticesToGlobalElmNodeIdx; }; diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.cpp index 5f000e2921..59e84ea4f4 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.cpp @@ -18,7 +18,7 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RimGeoMechResultSlot.h" -#include "RimReservoirView.h" +#include "RimGeoMechView.h" #include "RimLegendConfig.h" #include "RimDefines.h" @@ -58,6 +58,12 @@ QList RimGeoMechResultSlot::calculateValueOptions(const { QList options; + if (m_reservoirView) + { + // RimGeoMechCase* gmCase = m_reservoirView->geoMechCase(); + + } + if (&m_resultVariable == fieldNeedingOptions) { options.push_back(caf::PdmOptionItemInfo("Von Mises", QString("VonMises")) ); @@ -67,3 +73,11 @@ QList RimGeoMechResultSlot::calculateValueOptions(const } return options; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimGeoMechResultSlot::setReservoirView(RimGeoMechView* ownerReservoirView) +{ + m_reservoirView = ownerReservoirView; +} diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.h b/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.h index dcc9e8b8e0..8486b2d7e9 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.h +++ b/ApplicationCode/ProjectDataModel/RimGeoMechResultSlot.h @@ -24,6 +24,7 @@ #include "cafPdmPointer.h" class RimLegendConfig; +class RimGeoMechView; //================================================================================================== /// @@ -37,11 +38,17 @@ public: RimGeoMechResultSlot(void); virtual ~RimGeoMechResultSlot(void); + void setReservoirView(RimGeoMechView* ownerReservoirView); + caf::PdmField legendConfig; virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly); private: + caf::PdmField m_resultType; caf::PdmField m_resultVariable; + caf::PdmField m_componentName; + + caf::PdmPointer m_reservoirView; }; diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index 1e369e4327..925342126d 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -219,6 +219,14 @@ void RimGeoMechView::updateLegends() } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimGeoMechCase* RimGeoMechView::geoMechCase() +{ + return m_geomechCase; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.h b/ApplicationCode/ProjectDataModel/RimGeoMechView.h index fd7f09975d..8832ea905b 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.h +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.h @@ -64,6 +64,8 @@ public: }; void setGeoMechCase(RimGeoMechCase* gmCase); + RimGeoMechCase* geoMechCase(); + void loadDataAndUpdate(); virtual void setCurrentTimeStep(int frameIdx){}