MCPcopy Create free account
hub / github.com/comaps/comaps / GetPixelPosition

Method GetPixelPosition

libs/drape_frontend/selection_shape.cpp:74–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74std::optional<m2::PointD> SelectionShape::GetPixelPosition(ScreenBase const & screen, int zoomLevel) const
75{
76 if (!IsVisible())
77 return {};
78
79 m2::PointD pos = m_position;
80 double posZ = m_positionZ;
81 if (!m_selectionGeometry.empty())
82 {
83 pos = GetSelectionGeometryBoundingBox().Center();
84 posZ = 0.0;
85 }
86
87 m2::PointD const pt = screen.GtoP(pos);
88 if (!screen.IsReverseProjection3d(pt))
89 return screen.PtoP3d(pt, -posZ);
90 return {};
91}
92
93void SelectionShape::Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
94 ScreenBase const & screen, int zoomLevel, FrameValues const & frameValues)

Callers 2

ProcessSelectionMethod · 0.80
OnNewVisibleViewportMethod · 0.80

Calls 5

IsReverseProjection3dMethod · 0.80
PtoP3dMethod · 0.80
emptyMethod · 0.45
CenterMethod · 0.45
GtoPMethod · 0.45

Tested by

no test coverage detected