void CMeasuredThicknessContourView::DestroyData()
{
if ( m_Data != NULL )
{
for ( int i = 0; i < m_nSizeX; i++ )
delete[] m_Data[i];
}
delete[] m_Data;
}
void CMeasuredThicknessContourView::GetData()
{
if ( m_pDataController == NULL )
return;
CStrip* pStrip = m_pDataController->GetActiveStrip();
if ( pStrip == NULL )
return;
CMeasuredData* pData = pStrip->GetMeasuredData();
if ( pData != NULL )
{
CMeasuredDataMillPass* pMillPass = pData->GetMillPass(m_pDataController->GetActiveMillPassIndex());
if ( pMillPass != NULL && pMillPass->GetAllPoints().size() > 2 )
{
m_nSizeX = pMillPass->GetPointCount();
m_nSizeY = POINT_COUNT_PROFILE_THICKNESS;
m_Data = new double*[m_nSizeX];
int i = 0;
for ( auto point : pMillPass->GetAllPoints() )
{
m_Data[i] = new double[m_nSizeY];
memset(m_Data[i], 0, sizeof(double) * m_nSizeY);
for ( int j = 0; j < m_nSizeY; j++ )
{
m_Data[i][j] = point.second->GetThicknessVal(j);
}
i++;
}
}
else
m_nSizeX = 0;
}
else
m_nSizeX = 0;
}