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

Method TransformPath

Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:2938–2954  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2936
2937//------------------------------------------------------------------------------
2938void vtkOpenGLContextDevice2D::TransformPath(vtkPath* path) const
2939{
2940 // Transform the path with the modelview matrix:
2941 double modelview[16];
2942 vtkMatrix4x4::DeepCopy(modelview, this->ModelMatrix->GetMatrix());
2943
2944 // Transform the 2D path.
2945 float newPoint[3] = { 0, 0, 0 };
2946 vtkPoints* points = path->GetPoints();
2947 for (vtkIdType i = 0; i < path->GetNumberOfPoints(); ++i)
2948 {
2949 double* point = points->GetPoint(i);
2950 newPoint[0] = modelview[0] * point[0] + modelview[1] * point[1] + modelview[3];
2951 newPoint[1] = modelview[4] * point[0] + modelview[5] * point[1] + modelview[7];
2952 points->SetPoint(i, newPoint);
2953 }
2954}
2955
2956//------------------------------------------------------------------------------
2957void vtkOpenGLContextDevice2D::TransformPoint(float& x, float& y) const

Callers 1

DrawCircleGL2PSMethod · 0.95

Calls 6

DeepCopyFunction · 0.50
GetMatrixMethod · 0.45
GetPointsMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetPointMethod · 0.45
SetPointMethod · 0.45

Tested by

no test coverage detected