Commit Graph

28 Commits

Author SHA1 Message Date
Alexander Shalamov
b6b077d73a [core] Don't use signed int type for anchor segment 2019-12-09 17:26:13 +02:00
Mikhail Pozdnyakov
65d2f7ed6a [core] Introduce ProjectedCollisionBox type
ProjectedCollisionBox encapsulates geometry of the projected
collision box, it is using union and thus provides memory save
- 12 bytes per collision box instance.
2019-08-05 16:13:26 +03:00
Mikhail Pozdnyakov
55581b6e61 [core] Remove unused CollisionBox::offset 2019-08-05 16:13:26 +03:00
Ryan Hamley
0c6b1629ef [Core] Ensure queryRenderedFeatures accounts for icon-rotate (#13105) 2018-10-18 12:14:52 -07:00
Konstantin Käfer
4a3c4edb59 [android] add support for gnustl 2018-09-11 11:43:54 +02:00
Chris Loer
f9b36f9f5b [core] Add symbol-placement: line-center
- Remove unused/vestigial 'maxCameraDistance'
- Create a single collision circle for line labels that are less than half the width of a collision circle
2018-07-23 13:33:27 -07:00
Konstantin Käfer
d66251234d [core] don't use floating point versions of pow/log
GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable.
Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary.
See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
2018-06-04 10:43:21 +02:00
Chris Loer
c0cb210ddc [core] Switch from background to foreground placement
- Background placement code now just generates static symbol buffers
 - Don't render GeometryTiles until their symbols are loaded. This is necessary for the CrossTileSymbolIndex to successfully prevent flicker.
 - SymbolInstances are transferred to SymbolBucket for use on foreground during collision detection
 - Symbols are sorted on foreground by sorting their index buffer but leaving vertex buffers intact (only works within one segment)
 - Vertical glyphs are generated at same time as horizontal glyphs. `reprojectLineLabels` chooses which one to use at render time and hides the other.
 - Icons are now always represented with a single collision box, even if they're placed along a line (this means their rotation alignment may be wrong, but the approach of representing them with multiple collision boxes wasn't very accurate either).
 - Generate vertices for new debug collision boxes and collision circles
 - Only add symbols within tile boundaries (reduces work, avoids double-draw)
 - Update symbol_projection.cpp to support line label projection calls from CollisionIndex.
2017-11-17 10:05:15 -08:00
Konstantin Käfer
6b954677c0 [core] fix undefined behavior for division through 0 2017-07-17 15:02:47 +02:00
Ansis Brammanis
d661b4ba61 [core] port pitch-label collision hack
81363951ed
2017-07-11 09:10:25 -07:00
Chris Loer
7b29b90e7f [core] Extend collision feature boxes to accommodate potential pitch-scaling. 2017-07-11 09:10:23 -07:00
Bruno de Oliveira Abinader
fa36110dfb [tidy] modernize-use-auto 2017-05-12 18:07:36 +03:00
Bruno de Oliveira Abinader
98e2e59e5e [core] Safeguard PositionedIcon usage via optional 2017-04-14 12:33:13 -07:00
John Firebaugh
a7b7f3d442 [core] Fix whitespace; no need for explicit on multi-parameter constructors 2017-03-02 14:36:30 -08:00
Konstantin Käfer
f3191dbbb4 [core] change bool *AlongLine to SymbolPlacementType 2016-09-07 17:56:38 +02:00
Bruno de Oliveira Abinader
4161d197fd [tidy] Check modernize-pass-by-value
Ref: http://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html
2016-06-13 23:32:05 +03:00
John Firebaugh
b87fe16169 [core] CollisionBox::indexedFeature to CollisionFeature::indexedFeature
This eliminates the CollisionBox constructor that instantiates an "empty" IndexedSubfeature.
2016-05-12 08:36:30 -07:00
John Firebaugh
9330d674a9 [core] Use geometry.hpp's point 2016-05-05 11:30:53 -07:00
Ansis Brammanis
61d14089e0 [core] implement queryRenderedFeatures 2016-04-29 12:00:24 -07:00
Bruno de Oliveira Abinader
f3fc87261c [core] Coordinate is now GeometryCoordinate
Also introduced GeometryCoordinates (vector of GeometryCoordinate
items), to better cope with GeometryCollection.
2016-03-01 20:58:54 +00:00
Ansis Brammanis
5cd123422e [core] fix missing icon collision boxes
port https://github.com/mapbox/mapbox-gl-js/pull/1981
2016-01-22 18:00:49 -08:00
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
Ansis Brammanis
34a5bf665e fix bboxify where first box should be placed after anchor
-js: e99ed95aaba5e79c322733b32e03518b12203a79
2015-04-06 12:35:16 -07:00
Ansis Brammanis
466febd615 don't create infinitely many boxes for zero or negative height symbols
line-height or padding can make the height of a shaped object <= 0.
In these cases either create no boxes, or create boxes with a minimum
height to avoid creating too many of them.

-js: 9e78c02d8b22b60a08fdb28fd29eef1642f62d94
2015-04-02 16:48:43 -07:00
Ansis Brammanis
1d50485e5b port bboxifyLabel from -js 2015-04-01 19:03:01 -07:00
Ansis Brammanis
e1059e7125 port SymbolBucket::placeFeatures 2015-04-01 16:11:48 -07:00
Ansis Brammanis
dda1b770da port collision box debug rendering 2015-04-01 16:11:48 -07:00
Ansis Brammanis
8fd42f371f start porting CollisionTile and CollisionFeature 2015-04-01 16:11:48 -07:00