Some code


SUBMITTED BY: Guest

DATE: Oct. 9, 2014, 9:50 a.m.

FORMAT: C++

SIZE: 1.2 kB

HITS: 1276

  1. void CMeasuredThicknessContourView::DestroyData()
  2. {
  3. if ( m_Data != NULL )
  4. {
  5. for ( int i = 0; i < m_nSizeX; i++ )
  6. delete[] m_Data[i];
  7. }
  8. delete[] m_Data;
  9. }
  10. void CMeasuredThicknessContourView::GetData()
  11. {
  12. if ( m_pDataController == NULL )
  13. return;
  14. CStrip* pStrip = m_pDataController->GetActiveStrip();
  15. if ( pStrip == NULL )
  16. return;
  17. CMeasuredData* pData = pStrip->GetMeasuredData();
  18. if ( pData != NULL )
  19. {
  20. CMeasuredDataMillPass* pMillPass = pData->GetMillPass(m_pDataController->GetActiveMillPassIndex());
  21. if ( pMillPass != NULL && pMillPass->GetAllPoints().size() > 2 )
  22. {
  23. m_nSizeX = pMillPass->GetPointCount();
  24. m_nSizeY = POINT_COUNT_PROFILE_THICKNESS;
  25. m_Data = new double*[m_nSizeX];
  26. int i = 0;
  27. for ( auto point : pMillPass->GetAllPoints() )
  28. {
  29. m_Data[i] = new double[m_nSizeY];
  30. memset(m_Data[i], 0, sizeof(double) * m_nSizeY);
  31. for ( int j = 0; j < m_nSizeY; j++ )
  32. {
  33. m_Data[i][j] = point.second->GetThicknessVal(j);
  34. }
  35. i++;
  36. }
  37. }
  38. else
  39. m_nSizeX = 0;
  40. }
  41. else
  42. m_nSizeX = 0;
  43. }

comments powered by Disqus