dispmap/svpointcloud.cpp

34 lines
713 B
C++
Raw Normal View History

2014-07-23 20:50:12 +04:00
#include "svpointcloud.h"
2014-07-25 11:32:00 +04:00
SvPointCloud::SvPointCloud(uint width, uint height)
2014-07-23 20:50:12 +04:00
{
2014-07-25 11:32:00 +04:00
m_pointFiledHeight = height;
m_pointFiledWidth = width;
2014-07-25 18:44:11 +04:00
m_pointField = new SvPoint**[height]();
2014-07-25 11:32:00 +04:00
for (uint y = 0; y < height; y++) {
2014-07-25 18:44:11 +04:00
m_pointField[y] = new SvPoint*[width]();
2014-07-25 11:32:00 +04:00
}
2014-07-23 20:50:12 +04:00
}
2014-07-25 11:32:00 +04:00
SvPointCloud::~SvPointCloud()
2014-07-23 20:50:12 +04:00
{
2014-07-25 11:32:00 +04:00
for (uint y = 0; y < m_pointFiledHeight; y++) {
2014-07-25 18:44:11 +04:00
for (uint x = 0; x < m_pointFiledWidth; x++) {
if (m_pointField[y][x]) {
delete m_pointField[y][x];
}
}
2014-07-25 11:32:00 +04:00
delete[] m_pointField[y];
}
2014-07-23 20:50:12 +04:00
2014-07-25 11:32:00 +04:00
delete[] m_pointField;
}
2014-07-25 18:44:11 +04:00
void SvPointCloud::addPoint(SvPoint point)
2014-07-25 11:32:00 +04:00
{
2014-07-25 18:44:11 +04:00
m_pointField[point.y()][point.x()] = new SvPoint(point);
2014-07-23 20:50:12 +04:00
}