62 indexArray subClouds = buffer->getIndexArray(
"sub_clouds", numSubClouds, dummy);
64 vector<indexPair> pairs;
65 pairs.reserve(numSubClouds);
66 for (
size_t i = 0; i < numSubClouds; i++)
68 pairs[i].first = subClouds[i*2 + 0];
69 pairs[i].second = subClouds[i*2 + 1];
72 vector<indexPair>::iterator it;
75 size_t n = buffer->numPoints();
77 floatArr points = buffer->getPointArray();
80 for(it = pairs.begin(); it != pairs.end(); it ++)
86 for(
size_t a = p.first; a <= p.second; a++)
90 pc->
addPoint(points[a*3 + 0], points[a*3 + 1], points[a*3 + 2], colors[a*3 + 0], colors[a*3 + 1], colors[a*3 + 2]);
94 pc->
addPoint(points[a*3 + 0], points[a*3 + 1], points[a*3 + 2], 255, 0, 0);
131 vector<uColorVertex>::iterator p_it;
142 floatArr pointBuffer(
new float[3 * c]);
143 ucharArr colorBuffer(
new unsigned char[3 * c]);
151 vector<uColorVertex>::iterator p_it;
154 size_t bufferPos = 3 * c;
157 pointBuffer[bufferPos ] = v.
x;
158 pointBuffer[bufferPos + 1] = v.
y;
159 pointBuffer[bufferPos + 2] = v.
z;
161 colorBuffer[bufferPos ] = v.
r;
162 colorBuffer[bufferPos + 1] = v.
g;
163 colorBuffer[bufferPos + 2] = v.
b;
171 pcBuffer->setPointArray(pointBuffer, c);
172 pcBuffer->setColorArray(colorBuffer, c);
175 modelPtr->m_pointCloud = pcBuffer;
A class to handle point information with an arbitrarily large number of attribute channels...
map< PointCloud *, PointCloudAttribute * >::iterator pc_attr_it
MultiPointCloud(ModelPtr model, string name="<unnamed point cloud>")
boost::shared_array< unsigned char > ucharArr
map< PointCloud *, PointCloudAttribute * > m_clouds
std::shared_ptr< PointBuffer > PointBufferPtr
A dynamic bounding box class.
virtual void setName(string s)
void addCloud(PointCloud *pc)
boost::shared_array< unsigned int > indexArray
void removeCloud(PointCloud *pc)
boost::shared_array< float > floatArr
void addPoint(float x, float y, float z, unsigned char r, unsigned char g, unsigned char b)
vector< uColorVertex > m_points
BoundingBox< Vec > * boundingBox()
std::shared_ptr< Model > ModelPtr
BoundingBox< Vec > * m_boundingBox
std::pair< size_t, size_t > indexPair
void updateDisplayLists()
void init(PointBufferPtr buffer)