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

Function GetPointBounds

IO/ExportPDF/vtkPDFContextDevice2D.cxx:50–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48{
49
50void GetPointBounds(float* points, int numPoints, HPDF_REAL bbox[4], const float radius = 0.f)
51{
52 bbox[0] = static_cast<HPDF_REAL>(points[0]);
53 bbox[1] = static_cast<HPDF_REAL>(points[0]);
54 bbox[2] = static_cast<HPDF_REAL>(points[1]);
55 bbox[3] = static_cast<HPDF_REAL>(points[1]);
56
57 for (int i = 1; i < numPoints; ++i)
58 {
59 bbox[0] = std::min(bbox[0], static_cast<HPDF_REAL>(points[i * 2]));
60 bbox[1] = std::max(bbox[1], static_cast<HPDF_REAL>(points[i * 2]));
61 bbox[2] = std::min(bbox[2], static_cast<HPDF_REAL>(points[i * 2 + 1]));
62 bbox[3] = std::max(bbox[3], static_cast<HPDF_REAL>(points[i * 2 + 1]));
63 }
64
65 bbox[0] -= radius;
66 bbox[1] += radius;
67 bbox[2] -= radius;
68 bbox[3] += radius;
69}
70
71void PolygonToShading(
72 float* points, int numPoints, unsigned char* colors, int nc_comps, HPDF_Shading shading)

Callers 3

DrawPolyMethod · 0.85
DrawLinesMethod · 0.85
DrawColoredPolygonMethod · 0.85

Calls 2

minFunction · 0.50
maxFunction · 0.50

Tested by

no test coverage detected