#4068 System : Add forward declare

This commit is contained in:
Magne Sjaastad 2019-02-11 14:07:05 +01:00
parent 33eea61852
commit 67a960dae5
2 changed files with 29 additions and 17 deletions

View File

@ -39,7 +39,7 @@ RiuFemTimeHistoryResultAccessor::RiuFemTimeHistoryResultAccessor(RigGeoMechCaseD
int face,
const cvf::Vec3d& intersectionPointInDomain)
: m_geoMechCaseData(geomData),
m_femResultAddress(femResultAddress),
m_femResultAddress(new RigFemResultAddress(femResultAddress)),
m_gridIndex(gridIndex),
m_elementIndex(elementIndex),
m_face(face),
@ -60,7 +60,7 @@ RiuFemTimeHistoryResultAccessor::RiuFemTimeHistoryResultAccessor(RigGeoMechCaseD
const cvf::Vec3d& intersectionPointInDomain,
const std::array<cvf::Vec3f, 3>& intersectionTriangle)
: m_geoMechCaseData(geomData),
m_femResultAddress(femResultAddress),
m_femResultAddress(new RigFemResultAddress(femResultAddress)),
m_gridIndex(gridIndex),
m_elementIndex(elementIndex),
m_face(face),
@ -115,6 +115,14 @@ std::vector<double> RiuFemTimeHistoryResultAccessor::timeHistoryValues() const
return m_timeHistoryValues;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RiuFemTimeHistoryResultAccessor::closestNodeId() const
{
return m_closestNodeId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -123,7 +131,7 @@ void RiuFemTimeHistoryResultAccessor::computeTimeHistoryData()
m_timeHistoryValues.clear();
RigFemClosestResultIndexCalculator closestCalc(m_geoMechCaseData->femParts()->part(m_gridIndex),
m_femResultAddress.resultPosType,
m_femResultAddress->resultPosType,
m_elementIndex,
m_face,
m_intersectionPointInDomain );
@ -133,13 +141,13 @@ void RiuFemTimeHistoryResultAccessor::computeTimeHistoryData()
RigFemPartResultsCollection* femPartResultsColl = m_geoMechCaseData->femPartResults();
if (m_femResultAddress.resultPosType == RIG_ELEMENT_NODAL_FACE && m_hasIntersectionTriangle)
if (m_femResultAddress->resultPosType == RIG_ELEMENT_NODAL_FACE && m_hasIntersectionTriangle)
{
int closestElmNodeResIndex = closestCalc.closestElementNodeResIdx();
for ( int frameIdx = 0; frameIdx < femPartResultsColl->frameCount(); frameIdx++ )
{
RiuGeoMechXfTensorResultAccessor stressXfAccessor(femPartResultsColl, m_femResultAddress, frameIdx);
RiuGeoMechXfTensorResultAccessor stressXfAccessor(femPartResultsColl, *m_femResultAddress, frameIdx);
float scalarValue = stressXfAccessor.calculateElmNodeValue(m_intersectionTriangle, closestElmNodeResIndex);
m_timeHistoryValues.push_back(scalarValue);
}
@ -150,7 +158,7 @@ void RiuFemTimeHistoryResultAccessor::computeTimeHistoryData()
for ( int frameIdx = 0; frameIdx < femPartResultsColl->frameCount(); frameIdx++ )
{
const std::vector<float>& scalarResults = m_geoMechCaseData->femPartResults()->resultValues(m_femResultAddress, static_cast<int>(m_gridIndex), frameIdx);
const std::vector<float>& scalarResults = m_geoMechCaseData->femPartResults()->resultValues(*m_femResultAddress, static_cast<int>(m_gridIndex), frameIdx);
if ( scalarResults.size() )
{
float scalarValue = scalarResults[scalarResultIndex];

View File

@ -19,23 +19,26 @@
#pragma once
#include "RigFemResultAddress.h"
#include "cvfStructGrid.h"
#include "cvfBase.h"
#include "cvfVector3.h"
#include <QString>
#include <array>
#include <memory>
#include <vector>
class RigGeoMechCaseData;
class RigFemResultAddress;
class RiuFemTimeHistoryResultAccessor
{
public:
RiuFemTimeHistoryResultAccessor(RigGeoMechCaseData* geomData,
RiuFemTimeHistoryResultAccessor(RigGeoMechCaseData* geomData,
RigFemResultAddress femResultAddress,
size_t gridIndex,
size_t gridIndex,
int elementIndex,
int face,
int face,
const cvf::Vec3d& intersectionPointInDomain);
RiuFemTimeHistoryResultAccessor(RigGeoMechCaseData* geomData,
@ -43,19 +46,20 @@ public:
size_t gridIndex,
int elementIndex,
int face,
const cvf::Vec3d& intersectionPointInDomain,
const cvf::Vec3d& intersectionPointInDomain,
const std::array<cvf::Vec3f, 3>& m_intersectionTriangle);
QString geometrySelectionText() const;
std::vector<double> timeHistoryValues() const;
int closestNodeId() const { return m_closestNodeId; }
int closestNodeId() const;
private:
void computeTimeHistoryData();
private:
RigGeoMechCaseData* m_geoMechCaseData;
RigFemResultAddress m_femResultAddress;
RigGeoMechCaseData* m_geoMechCaseData;
std::unique_ptr<RigFemResultAddress> m_femResultAddress;
size_t m_gridIndex;
int m_elementIndex;