Commit Graph

46 Commits

Author SHA1 Message Date
John Firebaugh ddc5e324f6 Extract iD.Difference
iD.Difference represents the difference between two graphs.
It knows how to calculate the set of entities that were
created, modified, or deleted, and also contains the logic
for recursively extending a difference to the complete set
of entities that will require a redraw, taking into account
child and parent relationships.

Additionally, all history mutators now return a difference.
2013-02-02 19:47:56 -05:00
John Firebaugh a8410be6eb iD.actions.Join 2013-02-01 17:31:32 -05:00
John Firebaugh 9120f33aa7 ReverseWay -> Reverse 2013-02-01 17:31:32 -05:00
John Firebaugh c86792a77b SplitWay -> Split 2013-02-01 17:31:32 -05:00
John Firebaugh e1d5a0cb03 Unjoin -> Disconnect 2013-02-01 17:31:32 -05:00
John Firebaugh 58fcf746a2 Delete multiple 2013-02-01 15:08:41 -05:00
John Firebaugh 7ba31f05d2 Support deleting relations 2013-02-01 14:48:11 -05:00
John Firebaugh 3da0e70c0f Shift-selection 2013-02-01 14:31:47 -05:00
John Firebaugh 7e68e8e114 Add iD.Context
This is a facade interface that ties together a bunch of
different internal objects and will make it easier to write
tests for behaviors, modes, and operations.
2013-02-01 12:40:15 -05:00
John Firebaugh bbccec75be Convert Hash to a behavior 2013-01-31 18:28:24 -05:00
John Firebaugh 3605895dfa ChangeEntityTags -> ChangeTags 2013-01-31 12:41:29 -05:00
John Firebaugh 6f7079d11c AddWay/AddNode -> AddEntity 2013-01-31 12:06:21 -05:00
John Firebaugh 208ed6a2ed Move iD.geo tests to own file 2013-01-31 08:30:46 -05:00
John Firebaugh e381b6ab26 Extract AddMidpoint action 2013-01-30 15:47:33 -05:00
John Firebaugh 459dc00ce5 Change the midpoint data a bit
Store the ways which share the segment and the index of
the segment. This will be used in both DragWay and Draw
behaviors.
2013-01-30 15:47:33 -05:00
John Firebaugh 13e7d03395 Fix build 2013-01-29 19:02:34 -05:00
John Firebaugh de7fad5803 Move remaining XML stuff to Connection 2013-01-27 21:50:08 -05:00
John Firebaugh 646c746991 Convert iD.format.GeoJSON to member functions 2013-01-27 21:50:07 -05:00
John Firebaugh 292c916cb1 Converting some actions to entity methods
The guidelines here are:

Entity methods:
  return a modified entity
  don't necessarily maintain whole-graph consistency

Actions:
  return a modified graph
  always maintain whole-graph consistency
  call entity methods liberally
  generally don't call other actions
2013-01-23 12:40:27 -05:00
John Firebaugh b47bb517cf Sync packaged tests 2013-01-23 10:07:10 -05:00
John Firebaugh 29d608970b UnjoinNode action (fixes #442) 2013-01-23 10:07:10 -05:00
John Firebaugh 2ee07a3b74 Add iD.actions.AddRelationMember 2013-01-18 14:44:29 -08:00
John Firebaugh d40c645170 Fix packaged tests 2013-01-17 16:32:50 -08:00
John Firebaugh 3eaf4a46e0 Add CSS classes for relation memberships
An entity that is a member of a relation will have the classes
`member`, `member-role-<member role>`, and `member-type-<relation type>`.

The first use of these classes is to avoid filling multipolygon
member areas.
2013-01-17 15:17:40 -08:00
John Firebaugh 5a2444b551 Extract and fix extent/intersection calculations
Extents are now [[min x, min y], [max x, max y]].
2013-01-17 14:27:01 -08:00
John Firebaugh 9a76b81125 First cut on multipolygon rendering 2013-01-17 11:57:30 -08:00
John Firebaugh e24b22b518 Extract iD.svg.LineString 2013-01-17 11:57:29 -08:00
John Firebaugh 4c6757714c parentWays/Relations now take an entity 2013-01-11 17:26:25 -08:00
John Firebaugh 45fd260d8f Add basic Area test 2013-01-11 15:49:56 -08:00
John Firebaugh e95d163dbc Apply tag classes to vertices and points
While here, introduce a `classed` matcher for Chai.
2013-01-11 12:22:23 -08:00
John Firebaugh 577398ca21 Fix .shared classing
Now that Graph#parentWays is cached, the specialized Graph#parentStructure
method is no longer necessary.

This commit also demonstrates that it's relatively easy to write specs for
rendering now!
2013-01-11 11:56:37 -08:00
John Firebaugh b8310e2d9f Move to iD.svg.TagClasses 2013-01-11 11:56:37 -08:00
John Firebaugh bcb4de4305 Reverse directional tags and roles when reversing a way
Reverse known direction dependent tags other than `oneway`.
We assume that correcting a backwards oneway is the primary
reason for reversing a way.

The following transforms are performed:

Keys:
      *:right=* ⟺ *:left=*
    *:forward=* ⟺ *:backward=*
   direction=up ⟺ direction=down
     incline=up ⟺ incline=down
        *=right ⟺ *=left

Relation members:
   role=forward ⟺ role=backward

In addition, numeric-valued `incline` tags are negated.

The JOSM implementation was used as a guide, but transformations that 
were of unclear benefit or adjusted tags that don't seem to be used
in practice were omitted.

References:
   http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right
   http://wiki.openstreetmap.org/wiki/Key:direction#Steps
   http://wiki.openstreetmap.org/wiki/Key:incline
   http://wiki.openstreetmap.org/wiki/Route#Members
   http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java

Fixes #299.
2013-01-07 16:26:56 -08:00
John Firebaugh 2d3ce6c125 Extract hover behavior 2013-01-07 08:34:37 -08:00
John Firebaugh 3ffa8066c5 Taginfo typeahead on keys as well as values 2013-01-01 18:43:22 -08:00
John Firebaugh 5fe22be7a0 Introduce real Entity subclasses 2012-12-28 18:42:21 -08:00
John Firebaugh ad0efa4931 Place -> Point
We decided to use geometric terms for the modes.
2012-12-14 14:39:38 -08:00
John Firebaugh 209b87f7e8 Extract MoveWay action 2012-12-13 17:39:07 -08:00
John Firebaugh ee3f5cc768 Move -> MoveNode, in preparation for MoveWay 2012-12-13 17:39:07 -08:00
John Firebaugh c37aa11408 Start testing modes 2012-12-13 17:39:06 -08:00
John Firebaugh 8854dac623 More action specs; fix ReverseWay 2012-12-06 19:16:54 -05:00
John Firebaugh 812b427ac4 Split remove action into DeleteWay and DeleteNode 2012-12-05 16:14:39 -05:00
John Firebaugh 4a3169bb1d Test/refine iD.actions.remove 2012-12-05 16:14:39 -05:00
John Firebaugh 76849596f8 Move node removal into removeNodeWay action 2012-12-04 18:07:26 -05:00
John Firebaugh f8fde1f10d Move node update into addWayNode action 2012-12-04 17:54:08 -05:00
John Firebaugh 44933c471f Test against packaged result 2012-12-04 14:00:29 -05:00