本文整理汇总了C++中vesSharedPtr::computeBounds方法的典型用法代码示例。如果您正苦于以下问题:C++ vesSharedPtr::computeBounds方法的具体用法?C++ vesSharedPtr::computeBounds怎么用?C++ vesSharedPtr::computeBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vesSharedPtr
的用法示例。
在下文中一共展示了vesSharedPtr::computeBounds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenericConvertTriangles
void vesKiwiDataConversionTools::GenericConvertTriangles(vtkPolyData* input,
vesSharedPtr<vesGeometryData> output)
{
vesSourceDataP3N3f::Ptr sourceData (new vesSourceDataP3N3f());
double inPoint[3];
for (int i = 0; i < input->GetNumberOfPoints(); ++i){
input->GetPoint(i, inPoint);
vesVertexDataP3N3f vertexData;
vertexData.m_position = vesVector3f(inPoint[0], inPoint[1], inPoint[2]);
sourceData->pushBack(vertexData);
}
// copy triangles in place to ves structure
vtkCellArray* polys = input->GetPolys();
vtkIdType num;
vtkIdType* vertices;
vesSharedPtr< vesIndices<T> > indicesObj =
std::tr1::static_pointer_cast< vesIndices<T> >
(output->triangles()->getVesIndices());
typename vesIndices<T>::Indices* triangleIndices
= indicesObj->indices();
triangleIndices->clear();
triangleIndices->resize(polys->GetNumberOfCells());
T* outIndex = &triangleIndices->front();
for (int i = 0; i < polys->GetNumberOfCells(); ++i)
{
// there are 4 elements for each triangle cell in the array (count, i1, i2, i3)
polys->GetCell(4*i, num, vertices);
*outIndex++ = vertices[0];
*outIndex++ = vertices[1];
*outIndex++ = vertices[2];
}
if (input->GetPointData()->GetNormals())
{
vtkDataArray* normals = input->GetPointData()->GetNormals();
for (int i = 0; i < input->GetNumberOfPoints(); ++i)
{
sourceData->arrayReference()[i].m_normal[0] = normals->GetTuple(i)[0];
sourceData->arrayReference()[i].m_normal[1] = normals->GetTuple(i)[1];
sourceData->arrayReference()[i].m_normal[2] = normals->GetTuple(i)[2];
}
}
else
{
output->computeNormals<T>();
}
output->computeBounds();
output->addSource(sourceData);
}