MCPcopy Create free account
hub / github.com/Kitware/VTK / VToOPointNormals

Function VToOPointNormals

Rendering/RayTracing/vtkOSPRayPolyDataMapperNode.cxx:39–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37namespace vtkosp
38{
39VTK_ABI_NAMESPACE_BEGIN
40void VToOPointNormals(
41 vtkDataArray* vNormals, std::vector<osp::vec3f>& normals, vtkMatrix3x3* matrix)
42{
43 int numNormals = vNormals->GetNumberOfTuples();
44 normals.resize(numNormals);
45 for (int i = 0; i < numNormals; i++)
46 {
47 double vNormal[3];
48 double* vtmp = vNormals->GetTuple(i);
49 matrix->MultiplyPoint(vtmp, vNormal);
50 vtkMath::Normalize(vNormal);
51 normals[i] = osp::vec3f{ static_cast<float>(vNormal[0]), static_cast<float>(vNormal[1]),
52 static_cast<float>(vNormal[2]) };
53 }
54}
55
56//------------------------------------------------------------------------------
57void MakeCellMaterials(vtkOSPRayRendererNode* orn, OSPRenderer oRenderer, vtkPolyData* poly,

Callers 1

ORenderPolyMethod · 0.85

Calls 5

NormalizeFunction · 0.50
GetNumberOfTuplesMethod · 0.45
resizeMethod · 0.45
GetTupleMethod · 0.45
MultiplyPointMethod · 0.45

Tested by

no test coverage detected