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

Method ComputeGlyphScale

Rendering/Annotation/vtkXYPlotActor.cxx:2458–2469  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2456
2457//------------------------------------------------------------------------------
2458double vtkXYPlotActor::ComputeGlyphScale(int i, int* pos, int* pos2)
2459{
2460 vtkPolyData* pd = this->LegendActor->GetEntrySymbol(i);
2461 // pd->Update();
2462 double length = pd->GetLength();
2463 double sf = this->GlyphSize *
2464 sqrt(
2465 (double)(pos[0] - pos2[0]) * (pos[0] - pos2[0]) + (pos[1] - pos2[1]) * (pos[1] - pos2[1])) /
2466 length;
2467
2468 return sf;
2469}
2470
2471//------------------------------------------------------------------------------
2472// This assumes that there are multiple polylines

Callers 1

CreatePlotDataMethod · 0.95

Calls 3

GetEntrySymbolMethod · 0.80
sqrtFunction · 0.50
GetLengthMethod · 0.45

Tested by

no test coverage detected