├── .gitignore
├── developer.txt
├── example
├── 02_objects
│ ├── application.e
│ ├── objects.ecf
│ └── preview.e
├── 04_interfaces
│ ├── application.e
│ ├── interfaces.ecf
│ └── queries_and_commands.e
├── 06_creation
│ ├── application.e
│ ├── creation.ecf
│ └── line_building.e
├── 07_control
│ ├── application.e
│ ├── control.ecf
│ └── routes.e
├── 08_routines
│ ├── application.e
│ ├── routes.e
│ └── routines.ecf
├── 09_variables
│ ├── application.e
│ ├── assignments.e
│ └── variables.ecf
├── assignment_9
│ ├── application.e
│ ├── assignment_9.ecf
│ └── recursive_highlighting.e
├── city_vision2
│ ├── application.e
│ ├── city_vision2.ecf
│ ├── main_window.e
│ └── open.png
├── image
│ ├── bus.png
│ ├── free_moving.png
│ ├── man.png
│ ├── open.png
│ ├── taxi.png
│ ├── traffic_icon.png
│ ├── train.png
│ ├── tram.png
│ ├── zoom_in.png
│ └── zoom_out.png
└── map
│ ├── dump.log
│ ├── map.dtd
│ ├── paris.dump
│ ├── paris.xml
│ ├── paris
│ ├── centrepompidou.png
│ ├── chaillot.png
│ ├── citeuniversitaire.png
│ ├── congres.png
│ ├── defense.png
│ ├── eiffel.png
│ ├── hoteldeville.png
│ ├── invalides.png
│ ├── lachaise.png
│ ├── louvre.png
│ ├── madeleine.png
│ ├── maisondelaradio.png
│ ├── montparnasse.png
│ ├── notredame.png
│ ├── observatoire.png
│ ├── opera.png
│ ├── pantheon.png
│ ├── placedelaconcorde.png
│ ├── placedelanation.png
│ ├── placedelarepublique.png
│ ├── placedesvosges.png
│ ├── sacrecoeur.png
│ ├── saintgermaindespres.png
│ ├── tower.png
│ └── triomphe.png
│ ├── zurich_big.xml
│ ├── zurich_little.dump
│ ├── zurich_little.xml
│ ├── zurich_mini.xml
│ └── zurich_tiny.xml
├── forum.txt
├── history.txt
├── library
├── building
│ ├── traffic_apartment_building.e
│ ├── traffic_building.e
│ ├── traffic_landmark.e
│ ├── traffic_skyscraper.e
│ └── traffic_villa.e
├── factory
│ ├── traffic_map_factory.e
│ └── traffic_type_factory.e
├── input
│ ├── traffic_building_node_processor.e
│ ├── traffic_building_parser.e
│ ├── traffic_buildings_node_processor.e
│ ├── traffic_color_node_processor.e
│ ├── traffic_description_node_processor.e
│ ├── traffic_error_constants.e
│ ├── traffic_file_node_processor.e
│ ├── traffic_landmark_node_processor.e
│ ├── traffic_line_node_processor.e
│ ├── traffic_line_section_node_processor.e
│ ├── traffic_lines_node_processor.e
│ ├── traffic_map_node_processor.e
│ ├── traffic_map_parser.e
│ ├── traffic_node_processor.e
│ ├── traffic_node_processor_registry.e
│ ├── traffic_onroad_node_processor.e
│ ├── traffic_parse_error_constants.e
│ ├── traffic_place_node_processor.e
│ ├── traffic_places_node_processor.e
│ ├── traffic_point_node_processor.e
│ ├── traffic_polygon_node_processor.e
│ ├── traffic_road_node_processor.e
│ ├── traffic_roads_node_processor.e
│ └── traffic_xml_input_file_parser.e
├── moving
│ ├── traffic_bus.e
│ ├── traffic_cablecar.e
│ ├── traffic_dispatch_taxi.e
│ ├── traffic_free_moving.e
│ ├── traffic_line_vehicle.e
│ ├── traffic_moving.e
│ ├── traffic_passenger.e
│ ├── traffic_taxi.e
│ ├── traffic_taxi_office.e
│ ├── traffic_train.e
│ ├── traffic_tram.e
│ ├── traffic_trolley.e
│ ├── traffic_vehicle.e
│ └── traffic_wagon.e
├── structure
│ ├── container
│ │ ├── traffic_event_channel.e
│ │ ├── traffic_event_container.e
│ │ ├── traffic_event_linked_list.e
│ │ ├── traffic_item_hash_table.e
│ │ └── traffic_item_linked_list.e
│ └── graph
│ │ ├── dispenser
│ │ └── inverse_heap_priority_queue.e
│ │ ├── graph
│ │ ├── implementation
│ │ │ ├── adjacency_matrix_graph
│ │ │ │ ├── adjacency_matrix_graph.e
│ │ │ │ ├── adjacency_matrix_undirected_graph.e
│ │ │ │ ├── adjacency_matrix_undirected_weighted_graph.e
│ │ │ │ └── adjacency_matrix_weighted_graph.e
│ │ │ └── linked_graph
│ │ │ │ ├── linked_graph.e
│ │ │ │ ├── linked_graph_edge.e
│ │ │ │ ├── linked_graph_node.e
│ │ │ │ ├── linked_graph_weighted_edge.e
│ │ │ │ ├── linked_undirected_graph.e
│ │ │ │ ├── linked_undirected_weighted_graph.e
│ │ │ │ └── linked_weighted_graph.e
│ │ ├── structure
│ │ │ ├── edge.e
│ │ │ ├── graph.e
│ │ │ ├── graph_cursor.e
│ │ │ ├── node.e
│ │ │ ├── undirected_graph.e
│ │ │ ├── undirected_weighted_graph.e
│ │ │ ├── walkable.e
│ │ │ ├── weighted_edge.e
│ │ │ └── weighted_graph.e
│ │ └── walker
│ │ │ ├── abstract_fs_walker.e
│ │ │ ├── bfs_walker.e
│ │ │ └── dfs_walker.e
│ │ ├── topological_sort
│ │ └── topological_sorter.e
│ │ ├── tree
│ │ ├── b_tree.e
│ │ └── balanced_search_tree.e
│ │ └── union_find
│ │ └── union_find_structure.e
├── traffic_building_randomizer.e
├── traffic_city.e
├── traffic_city_item.e
├── traffic_color.e
├── traffic_constants.e
├── traffic_eiffelmedia.ecf
├── traffic_exchange_segment.e
├── traffic_graph.e
├── traffic_grid.e
├── traffic_id_manager.e
├── traffic_leg.e
├── traffic_line.e
├── traffic_line_cursor.e
├── traffic_line_segment.e
├── traffic_map_loader.e
├── traffic_node.e
├── traffic_point.e
├── traffic_point_randomizer.e
├── traffic_polygon.e
├── traffic_road.e
├── traffic_road_segment.e
├── traffic_route.e
├── traffic_route_calculator.e
├── traffic_route_randomizer.e
├── traffic_segment.e
├── traffic_segment_state.e
├── traffic_simple_line.e
├── traffic_simple_stop.e
├── traffic_station.e
├── traffic_station_information.e
├── traffic_stop.e
├── traffic_time.e
├── traffic_vision2.ecf
├── traffic_vision2_safe.ecf
├── type
│ ├── traffic_type.e
│ ├── traffic_type_bus.e
│ ├── traffic_type_dispatcher_taxi.e
│ ├── traffic_type_event_taxi.e
│ ├── traffic_type_lightrail.e
│ ├── traffic_type_line.e
│ ├── traffic_type_rail.e
│ ├── traffic_type_railroad.e
│ ├── traffic_type_road.e
│ ├── traffic_type_street.e
│ ├── traffic_type_tram.e
│ └── traffic_type_walking.e
├── utility
│ ├── gl_tools
│ │ ├── gl_vector_3d.e
│ │ └── gl_vector_4d.e
│ ├── traffic_error_codes.e
│ ├── traffic_error_handler.e
│ ├── traffic_error_messages.e
│ └── traffic_shared_error_handler.e
└── visualization
│ ├── em
│ ├── time
│ │ ├── traffic_em_time.e
│ │ └── traffic_shared_time.e
│ ├── traffic_em_scene.e
│ ├── visualization_2d
│ │ ├── traffic_2d_building_view.e
│ │ ├── traffic_2d_line_view.e
│ │ ├── traffic_2d_map_widget.e
│ │ ├── traffic_2d_moving_view.e
│ │ ├── traffic_2d_path_view.e
│ │ ├── traffic_2d_place_view.e
│ │ ├── traffic_2d_road_view.e
│ │ ├── traffic_2d_scene.e
│ │ ├── traffic_2d_view.e
│ │ ├── traffic_2d_view_container.e
│ │ └── traffic_2d_view_factory.e
│ └── visualization_3d
│ │ ├── em_9_datastructures
│ │ ├── em_abstract_vector.e
│ │ ├── em_abstract_vector1.e
│ │ ├── em_abstract_vector1_array.e
│ │ ├── em_abstract_vector2.e
│ │ ├── em_abstract_vector2_array.e
│ │ ├── em_abstract_vector3.e
│ │ ├── em_abstract_vector3_array.e
│ │ ├── em_abstract_vector4.e
│ │ ├── em_abstract_vector4_array.e
│ │ ├── em_abstract_vector_array.e
│ │ ├── em_matrix44.e
│ │ ├── em_matrix44_ref.e
│ │ ├── em_plane.e
│ │ ├── em_plane_ref.e
│ │ ├── em_quaternion.e
│ │ ├── em_quaternion_ref.e
│ │ ├── em_vector1d.e
│ │ ├── em_vector1d_array.e
│ │ ├── em_vector1d_ref.e
│ │ ├── em_vector1f.e
│ │ ├── em_vector1f_array.e
│ │ ├── em_vector1f_ref.e
│ │ ├── em_vector1i.e
│ │ ├── em_vector1i_array.e
│ │ ├── em_vector1i_ref.e
│ │ ├── em_vector2d.e
│ │ ├── em_vector2d_array.e
│ │ ├── em_vector2d_ref.e
│ │ ├── em_vector2f.e
│ │ ├── em_vector2f_array.e
│ │ ├── em_vector2f_ref.e
│ │ ├── em_vector2i.e
│ │ ├── em_vector2i_array.e
│ │ ├── em_vector2i_ref.e
│ │ ├── em_vector3d.e
│ │ ├── em_vector3d_array.e
│ │ ├── em_vector3d_ref.e
│ │ ├── em_vector3f.e
│ │ ├── em_vector3f_array.e
│ │ ├── em_vector3f_ref.e
│ │ ├── em_vector3i.e
│ │ ├── em_vector3i_array.e
│ │ ├── em_vector3i_ref.e
│ │ ├── em_vector4d.e
│ │ ├── em_vector4d_array.e
│ │ ├── em_vector4d_ref.e
│ │ ├── em_vector4f.e
│ │ ├── em_vector4f_array.e
│ │ ├── em_vector4f_ref.e
│ │ ├── em_vector4i.e
│ │ ├── em_vector4i_array.e
│ │ └── em_vector4i_ref.e
│ │ ├── new
│ │ ├── te_3d_camera.e
│ │ ├── te_3d_cluster.e
│ │ ├── te_3d_face.e
│ │ ├── te_3d_infinite_light.e
│ │ ├── te_3d_light_source.e
│ │ ├── te_3d_member.e
│ │ ├── te_3d_member_factory.e
│ │ ├── te_3d_member_factory_fromfile.e
│ │ ├── te_3d_member_factory_fromfile_obj.e
│ │ ├── te_3d_member_factory_primitive.e
│ │ ├── te_3d_node.e
│ │ ├── te_3d_ressource.e
│ │ ├── te_3d_scene_importer.e
│ │ ├── te_3d_shadow_volume.e
│ │ ├── te_3d_shared_globals.e
│ │ ├── te_3d_target_camera.e
│ │ ├── te_3d_text_scanner.e
│ │ ├── te_3d_transform.e
│ │ ├── te_gl_value.e
│ │ ├── te_level_of_detail.e
│ │ ├── te_material.e
│ │ ├── te_material_complex.e
│ │ ├── te_material_factory.e
│ │ ├── te_material_factory_mtl.e
│ │ ├── te_material_simple.e
│ │ ├── te_renderpass.e
│ │ ├── te_renderpass_beauty.e
│ │ ├── te_renderpass_lensflare.e
│ │ ├── te_renderpass_manager.e
│ │ └── te_renderpass_stencilshadow.e
│ │ ├── nodes
│ │ ├── traffic_3d_building_factory.e
│ │ ├── traffic_3d_connection_factory.e
│ │ ├── traffic_3d_daynight_renderable.e
│ │ ├── traffic_3d_moving_daynight_renderable.e
│ │ ├── traffic_3d_moving_factory.e
│ │ ├── traffic_3d_moving_renderable.e
│ │ ├── traffic_3d_place_factory.e
│ │ ├── traffic_3d_renderable.e
│ │ ├── traffic_3d_renderable_container.e
│ │ └── traffic_3d_sun_representation.e
│ │ ├── traffic_3d_map_widget.e
│ │ ├── traffic_3d_scene.e
│ │ ├── traffic_3d_view_factory.e
│ │ ├── traffic_file_dialog.e
│ │ ├── traffic_sun.e
│ │ └── traffic_time_counter.e
│ ├── traffic_city_widget.e
│ ├── traffic_view.e
│ ├── traffic_view_container.e
│ ├── traffic_view_factory.e
│ └── vision2
│ ├── drawable
│ ├── canvas.e
│ ├── drawable_circle.e
│ ├── drawable_icon.e
│ ├── drawable_object.e
│ ├── drawable_object_container.e
│ ├── drawable_pixmap.e
│ ├── drawable_polygon.e
│ ├── drawable_polyline.e
│ ├── drawable_rectangle.e
│ ├── drawable_rounded_rectangle.e
│ ├── drawable_spot.e
│ ├── drawable_text.e
│ ├── real_coordinate.e
│ ├── real_rectangle.e
│ └── zoomable_canvas.e
│ ├── time
│ ├── traffic_shared_time.e
│ └── traffic_vision2_time.e
│ ├── touch
│ ├── touch_paris_objects.e
│ ├── tourism.e
│ ├── traffic_console.e
│ └── traffic_main_window.e
│ ├── traffic_city_canvas.e
│ ├── traffic_vs_view_container.e
│ └── views
│ ├── traffic_building_icon_view.e
│ ├── traffic_building_simple_view.e
│ ├── traffic_building_view.e
│ ├── traffic_line_segment_view.e
│ ├── traffic_line_view.e
│ ├── traffic_moving_deferred_view.e
│ ├── traffic_moving_icon_view.e
│ ├── traffic_moving_view.e
│ ├── traffic_road_view.e
│ ├── traffic_route_view.e
│ ├── traffic_station_view.e
│ ├── traffic_vs_view.e
│ └── traffic_vs_view_factory.e
├── readme.md
├── solution
├── 02_objects
│ ├── application.e
│ ├── objects.ecf
│ └── preview.e
├── 04_interfaces
│ ├── application.e
│ ├── interfaces.ecf
│ └── queries_and_commands.e
├── 06_creation
│ ├── application.e
│ ├── creation.ecf
│ └── line_building.e
├── 07_control
│ ├── application.e
│ ├── control.ecf
│ └── routes.e
├── 08_routines
│ ├── application.e
│ ├── routes.e
│ └── routines.ecf
├── 09_variables
│ ├── application.e
│ ├── assignments.e
│ └── variables.ecf
├── assignment_9
│ ├── application.e
│ ├── assignment_9.ecf
│ └── recursive_highlighting.e
├── city_vision2
│ ├── application.e
│ ├── city_vision2.ecf
│ ├── main_window.e
│ └── open.png
├── image
│ ├── bus.png
│ ├── free_moving.png
│ ├── man.png
│ ├── open.png
│ ├── taxi.png
│ ├── traffic_icon.png
│ ├── train.png
│ ├── tram.png
│ ├── zoom_in.png
│ └── zoom_out.png
└── map
│ ├── dump.log
│ ├── map.dtd
│ ├── paris.dump
│ ├── paris.xml
│ ├── paris
│ ├── centrepompidou.png
│ ├── chaillot.png
│ ├── citeuniversitaire.png
│ ├── congres.png
│ ├── defense.png
│ ├── eiffel.png
│ ├── hoteldeville.png
│ ├── invalides.png
│ ├── lachaise.png
│ ├── louvre.png
│ ├── madeleine.png
│ ├── maisondelaradio.png
│ ├── montparnasse.png
│ ├── notredame.png
│ ├── observatoire.png
│ ├── opera.png
│ ├── pantheon.png
│ ├── placedelaconcorde.png
│ ├── placedelanation.png
│ ├── placedelarepublique.png
│ ├── placedesvosges.png
│ ├── sacrecoeur.png
│ ├── saintgermaindespres.png
│ ├── tower.png
│ └── triomphe.png
│ ├── zurich_big.xml
│ ├── zurich_little.dump
│ ├── zurich_little.xml
│ ├── zurich_mini.xml
│ └── zurich_tiny.xml
└── todo_.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | EIFGENs
2 | *.swp
3 | *.rc
4 |
--------------------------------------------------------------------------------
/developer.txt:
--------------------------------------------------------------------------------
1 | Traffic
2 | Version 3.4
3 |
4 | 1. Requirements
5 | 2. Build environment
6 | 3. Directory layout
7 | 4. Style Guides
8 |
9 | 1. Requirements
10 | ____________________________________________________________
11 |
12 | 1.1 Traffic relies on
13 |
14 | EiffelStudio 19.12. The vision2 examples do not rely on any additional libraries.
15 |
16 | 2. Build environment
17 | ____________________________________________________________
18 |
19 | Traffic relies on ecf files (and gobo tools for svn version) for its build process. See readme.txt for further information.
20 |
21 | 3. Directory layout
22 | ____________________________________________________________
23 |
24 | example : The applications (the examples to work on)
25 | library : Traffic library you can use in your application
26 | solution : The application solutions (predefined examples)
27 | developer.txt : This file
28 | forum.txt : The Eiffel Forum License II
29 | readme.md : Installation instructions for users
30 |
31 | 4. Style Guides
32 | ____________________________________________________________
33 |
34 | - Until an autmatic style checker is available we try to adhere the following
35 | Style Guides: http://archive.eiffel.com/doc/manuals/language/style/style.pdf
36 | and to the $GOBO/doc/guidelines
37 |
38 |
--------------------------------------------------------------------------------
/example/02_objects/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Generated by the New Vision2 Application Wizard."
4 | date : "$Date: 2007/7/16 12:52:13 $"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | local
29 | prev: PREVIEW
30 | do
31 | create first_window
32 | create prev
33 | first_window.set_example (prev, agent prev.explore)
34 | first_window.set_title ("Preview (chapter 2)")
35 | first_window.show
36 | end
37 |
38 | feature {NONE} -- Implementation
39 |
40 | first_window: TRAFFIC_MAIN_WINDOW
41 | -- Main window.
42 |
43 | end -- class APPLICATION
44 |
--------------------------------------------------------------------------------
/example/02_objects/preview.e:
--------------------------------------------------------------------------------
1 | class PREVIEW inherit
2 | TOURISM
3 |
4 | feature -- Explore Paris
5 |
6 | explore
7 | -- Show city info and route.
8 | do
9 |
10 | end
11 |
12 | end
13 |
--------------------------------------------------------------------------------
/example/04_interfaces/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Generated by the New Vision2 Application Wizard."
4 | date : "$Date: 2007/7/16 12:52:13 $"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | local
29 | q_and_c: QUERIES_AND_COMMANDS
30 | do
31 | create first_window
32 | create q_and_c
33 | first_window.set_example (q_and_c, agent q_and_c.tryout)
34 | first_window.set_title ("Queries - Commands (chapter 4)")
35 | first_window.show
36 | end
37 |
38 | feature {NONE} -- Implementation
39 |
40 | first_window: TRAFFIC_MAIN_WINDOW
41 | -- Main window.
42 |
43 | end -- class APPLICATION
44 |
--------------------------------------------------------------------------------
/example/04_interfaces/queries_and_commands.e:
--------------------------------------------------------------------------------
1 | class QUERIES_AND_COMMANDS inherit
2 | TOURISM
3 |
4 | feature -- Commands and Queries
5 |
6 | tryout
7 | -- Try out queries and commands on lines.
8 | do
9 |
10 | end
11 |
12 | end
13 |
--------------------------------------------------------------------------------
/example/06_creation/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Generated by the New Vision2 Application Wizard."
4 | date : "$Date: 2007/7/16 12:52:13 $"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | local
29 | lb: LINE_BUILDING
30 | do
31 | create first_window
32 | create lb
33 | first_window.set_example (lb, agent lb.build_a_line)
34 | first_window.set_title ("Line building (chapter 6)")
35 | first_window.show
36 | end
37 |
38 | feature {NONE} -- Implementation
39 |
40 | first_window: TRAFFIC_MAIN_WINDOW
41 | -- Main window.
42 |
43 | end -- class APPLICATION
44 |
--------------------------------------------------------------------------------
/example/06_creation/line_building.e:
--------------------------------------------------------------------------------
1 | class LINE_BUILDING inherit
2 | TOURISM
3 |
4 | feature -- Line building
5 |
6 | build_a_line
7 | -- Build an imaginary line and highlight it on the map.
8 | do
9 | Paris.display
10 | -- "Create new line, fill in its stations and add it to Paris"
11 | -- "Hightlight the new line on the map"
12 | end
13 |
14 | end
15 |
--------------------------------------------------------------------------------
/example/07_control/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Generated by the New Vision2 Application Wizard."
4 | date : "$Date: 2007/7/16 12:52:13 $"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | local
29 | cont: ROUTES
30 | do
31 | create first_window
32 | create cont
33 | first_window.set_example (cont, agent cont.traverse)
34 | first_window.set_title ("Control (chapter 7)")
35 | first_window.show
36 | end
37 |
38 | feature {NONE} -- Implementation
39 |
40 | first_window: TRAFFIC_MAIN_WINDOW
41 | -- Main window.
42 |
43 | end -- class APPLICATION
44 |
--------------------------------------------------------------------------------
/example/07_control/routes.e:
--------------------------------------------------------------------------------
1 | class
2 | ROUTES
3 |
4 | inherit
5 |
6 | TOURISM
7 |
8 | feature -- Routes
9 |
10 | traverse
11 | -- Build a route and traverse Line8.
12 | do
13 |
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/example/08_routines/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Generated by the New Vision2 Application Wizard."
4 | date : "$Date: 2007/7/16 12:52:13 $"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | local
29 | routes: ROUTES
30 | do
31 | create first_window
32 | create routes
33 | first_window.set_example (routes, agent routes.traverse)
34 | first_window.set_title ("Routines (chapter 8)")
35 | first_window.show
36 | end
37 |
38 | feature {NONE} -- Implementation
39 |
40 | first_window: TRAFFIC_MAIN_WINDOW
41 | -- Main window.
42 |
43 | end -- class APPLICATION
44 |
--------------------------------------------------------------------------------
/example/08_routines/routes.e:
--------------------------------------------------------------------------------
1 | class
2 | ROUTES
3 |
4 | inherit
5 |
6 | TOURISM
7 |
8 | feature -- Traversing
9 |
10 | traverse
11 | -- Traverse Line8.
12 | do
13 |
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/example/09_variables/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Corinne Mueller."
4 | date : "10.01.2008"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | local
29 | assi: ASSIGNMENTS
30 | do
31 | create first_window
32 | create assi
33 | first_window.set_example (assi, agent assi.startup)
34 | first_window.set_title ("Variables, Assignment and References (Chapter 9, Touch of Class)")
35 | first_window.show
36 | end
37 |
38 | feature {NONE} -- Implementation
39 |
40 | first_window: TRAFFIC_MAIN_WINDOW
41 | -- Main window.
42 |
43 | end -- class APPLICATION
44 |
--------------------------------------------------------------------------------
/example/09_variables/assignments.e:
--------------------------------------------------------------------------------
1 | class
2 | ASSIGNMENTS
3 |
4 | inherit
5 |
6 | TOURISM
7 |
8 | feature -- Path building
9 |
10 | startup
11 |
12 | do
13 | paris.display
14 | console.show (total_time8)
15 | console.show (highest_name (Line8))
16 | end
17 |
18 |
19 | total_time8 : REAL_64
20 | -- Return the travel time on the Metro Line 8
21 | do
22 |
23 | end
24 |
25 | highest_name(line: TRAFFIC_LINE): STRING
26 | -- Alphabetically last of names of stations on line
27 | do
28 |
29 | end
30 |
31 | end
32 |
--------------------------------------------------------------------------------
/example/assignment_9/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Generated by the New Vision2 Application Wizard."
4 | date : "$Date: 2007/7/16 12:52:13 $"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | local
29 | recursive_highlighting: RECURSIVE_HIGHLIGHTING
30 | do
31 | create first_window
32 | create recursive_highlighting
33 | first_window.set_example (recursive_highlighting, agent recursive_highlighting.show)
34 | first_window.set_title ("Assignment 9 (recursive highlighting)")
35 | first_window.show
36 | end
37 |
38 | feature {NONE} -- Implementation
39 |
40 | first_window: TRAFFIC_MAIN_WINDOW
41 | -- Main window.
42 |
43 | end -- class APPLICATION
44 |
--------------------------------------------------------------------------------
/example/assignment_9/assignment_9.ecf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 |
36 |
37 |
38 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/example/assignment_9/recursive_highlighting.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "Recursive highlighting class (Assignment 9)"
3 | date: "$Date$"
4 | revision: "$Revision$"
5 |
6 | class
7 | RECURSIVE_HIGHLIGHTING
8 |
9 | inherit
10 | TOURISM
11 |
12 | feature -- Explore Paris
13 | show
14 | -- Highlight stations that are reachable within a certain time limit.
15 | do
16 | Paris.display
17 | highlight_reachable_stations (Station_chatelet, 10.0)
18 | end
19 |
20 | highlight_reachable_stations (s: TRAFFIC_STATION; t: REAL_64)
21 | -- Highlight all stations that are reachable from `s' within travel time `t'.
22 | require
23 | s_exists: s /= Void
24 | t_positive: t > 0.0
25 | local
26 | stop: TRAFFIC_STOP
27 | i: INTEGER
28 | do
29 | s.highlight
30 | from
31 | i := 1
32 | until
33 | i > s.stops.count
34 | loop
35 | stop := s.stops.i_th (i)
36 | if stop.right /= Void and then (t - stop.time_to_next) >= 0.0 then
37 | highlight_reachable_stations (stop.right.station, t - stop.time_to_next)
38 | end
39 | i := i + 1
40 | end
41 | end
42 |
43 | end
44 |
--------------------------------------------------------------------------------
/example/city_vision2/application.e:
--------------------------------------------------------------------------------
1 | note
2 | description : "Root class for this application."
3 | author : "Generated by the New Vision2 Application Wizard."
4 | date : "$Date: 2007/7/16 12:52:13 $"
5 | revision : "1.0.0"
6 |
7 | class
8 | APPLICATION
9 |
10 | inherit
11 | EV_APPLICATION
12 |
13 | create
14 | make_and_launch
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make_and_launch
19 | -- Initialize and launch application
20 | do
21 | default_create
22 | prepare
23 | launch
24 | end
25 |
26 | prepare
27 | -- Prepare the first window to be displayed.
28 | -- Perform one call to first window in order to
29 | -- avoid to violate the invariant of class EV_APPLICATION.
30 | do
31 | -- create and initialize the first window.
32 | create first_window
33 |
34 | -- Show the first window.
35 | --| TODO: Remove this line if you don't want the first
36 | --| window to be shown at the start of the program.
37 | first_window.show
38 | end
39 |
40 | feature {NONE} -- Implementation
41 |
42 | first_window: MAIN_WINDOW
43 | -- Main window.
44 |
45 | end -- class APPLICATION
46 |
--------------------------------------------------------------------------------
/example/city_vision2/open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/city_vision2/open.png
--------------------------------------------------------------------------------
/example/image/bus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/bus.png
--------------------------------------------------------------------------------
/example/image/free_moving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/free_moving.png
--------------------------------------------------------------------------------
/example/image/man.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/man.png
--------------------------------------------------------------------------------
/example/image/open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/open.png
--------------------------------------------------------------------------------
/example/image/taxi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/taxi.png
--------------------------------------------------------------------------------
/example/image/traffic_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/traffic_icon.png
--------------------------------------------------------------------------------
/example/image/train.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/train.png
--------------------------------------------------------------------------------
/example/image/tram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/tram.png
--------------------------------------------------------------------------------
/example/image/zoom_in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/zoom_in.png
--------------------------------------------------------------------------------
/example/image/zoom_out.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/image/zoom_out.png
--------------------------------------------------------------------------------
/example/map/dump.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/dump.log
--------------------------------------------------------------------------------
/example/map/map.dtd:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
14 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
63 |
64 |
65 |
66 |
67 |
72 |
--------------------------------------------------------------------------------
/example/map/paris.dump:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris.dump
--------------------------------------------------------------------------------
/example/map/paris/centrepompidou.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/centrepompidou.png
--------------------------------------------------------------------------------
/example/map/paris/chaillot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/chaillot.png
--------------------------------------------------------------------------------
/example/map/paris/citeuniversitaire.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/citeuniversitaire.png
--------------------------------------------------------------------------------
/example/map/paris/congres.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/congres.png
--------------------------------------------------------------------------------
/example/map/paris/defense.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/defense.png
--------------------------------------------------------------------------------
/example/map/paris/eiffel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/eiffel.png
--------------------------------------------------------------------------------
/example/map/paris/hoteldeville.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/hoteldeville.png
--------------------------------------------------------------------------------
/example/map/paris/invalides.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/invalides.png
--------------------------------------------------------------------------------
/example/map/paris/lachaise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/lachaise.png
--------------------------------------------------------------------------------
/example/map/paris/louvre.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/louvre.png
--------------------------------------------------------------------------------
/example/map/paris/madeleine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/madeleine.png
--------------------------------------------------------------------------------
/example/map/paris/maisondelaradio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/maisondelaradio.png
--------------------------------------------------------------------------------
/example/map/paris/montparnasse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/montparnasse.png
--------------------------------------------------------------------------------
/example/map/paris/notredame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/notredame.png
--------------------------------------------------------------------------------
/example/map/paris/observatoire.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/observatoire.png
--------------------------------------------------------------------------------
/example/map/paris/opera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/opera.png
--------------------------------------------------------------------------------
/example/map/paris/pantheon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/pantheon.png
--------------------------------------------------------------------------------
/example/map/paris/placedelaconcorde.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/placedelaconcorde.png
--------------------------------------------------------------------------------
/example/map/paris/placedelanation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/placedelanation.png
--------------------------------------------------------------------------------
/example/map/paris/placedelarepublique.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/placedelarepublique.png
--------------------------------------------------------------------------------
/example/map/paris/placedesvosges.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/placedesvosges.png
--------------------------------------------------------------------------------
/example/map/paris/sacrecoeur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/sacrecoeur.png
--------------------------------------------------------------------------------
/example/map/paris/saintgermaindespres.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/saintgermaindespres.png
--------------------------------------------------------------------------------
/example/map/paris/tower.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/tower.png
--------------------------------------------------------------------------------
/example/map/paris/triomphe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/paris/triomphe.png
--------------------------------------------------------------------------------
/example/map/zurich_little.dump:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/example/map/zurich_little.dump
--------------------------------------------------------------------------------
/example/map/zurich_tiny.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
69 |
--------------------------------------------------------------------------------
/forum.txt:
--------------------------------------------------------------------------------
1 | Eiffel Forum License, version 2
2 |
3 | 1. Permission is hereby granted to use, copy, modify and/or distribute
4 | this package, provided that:
5 | * copyright notices are retained unchanged,
6 | * any distribution of this package, whether modified or not,
7 | includes this license text.
8 | 2. Permission is hereby also granted to distribute binary programs which
9 | depend on this package. If the binary program depends on a modified
10 | version of this package, you are encouraged to publicly release the
11 | modified version of this package.
12 |
13 | THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR
14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 | DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR
17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 | DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.
19 |
--------------------------------------------------------------------------------
/history.txt:
--------------------------------------------------------------------------------
1 | Version 3.4
2 | * Updated obsolete syntax
3 | * Renamed examples folder as solutions
4 | * Built new examples folders to match the printed examples of the textbook
5 | Version 3.3 (svn 1079) 22.9.2008
6 | * Traffic synchronized with the textbook "Touch of Class" (although many changes discussed still need to be integrated in the book)
7 | * All examples are implemented
8 | * Movings are displayed as images
9 |
10 | Version 3.2 (svn 935) 26.9.2007
11 | * Vision2 widget support (no eiffelmedia installation needed any more for running traffic)
12 | * More examples are implemented
13 | * Improved overall design and structure
14 |
15 | Version 3.1 (snv 800) 25.10.2006
16 |
17 | * Taxis, trams, passengers, and other vehicles
18 | * Improved 3d visualization with 3d obj models and textures
19 | * Improved performance of display
20 | * Roads and stops of transportation lines
21 | * Extended path calculation
22 |
23 | Version 3.0 31.3.2006
24 |
25 | * Buildings included in the library
26 | * Time and travelers
27 | * 3D-Widgets included in the library
28 | * First examples of Touch of Class
29 | * Touch library
30 |
31 | Version 2.1 25.11.2005
32 |
33 | * Gobification of build process
34 | * Bugfixes
35 |
36 | Version 2.0 31.10.2006
37 |
38 | * Switch from EiffelVision to EiffelMedia
39 | * Prototype for 3D Graphics
40 | * Redesing of the Traffic library
41 |
42 | Version 1.0 25.10.2004
43 |
44 | * Major redesign of Traffic library
45 | * Flathunt application
46 | * Touch of Class application
47 |
48 | Version 0.1 Not available
49 |
50 | * Initial verion (not available any more)
--------------------------------------------------------------------------------
/library/building/traffic_apartment_building.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "Apartment buildings with lots of condos"
3 | date: "$Date$"
4 | revision: "$Revision$"
5 |
6 | class
7 | TRAFFIC_APARTMENT_BUILDING
8 |
9 | inherit
10 |
11 | TRAFFIC_BUILDING
12 | redefine
13 | make_new
14 | end
15 |
16 | create
17 |
18 | make_new, make_default
19 |
20 | feature {NONE} -- Initialization
21 |
22 | make_default (a_center: TRAFFIC_POINT)
23 | -- Initialize with default size.
24 | require
25 | center_valid: a_center /= Void
26 | do
27 | make_new (default_width, default_depth, default_height, a_center)
28 | is_apartment_building := True
29 | ensure
30 | is_apartment_building: is_apartment_building and not is_villa and not is_skyscraper and not is_landmark
31 | size_set: width = default_width and height = default_height and depth = default_depth
32 | center_set: center = a_center
33 | end
34 |
35 | make_new (a_width, a_depth, a_height: REAL_64; a_center: TRAFFIC_POINT)
36 | -- Initialize with size.
37 | do
38 | Precursor (a_width, a_depth, a_height, a_center)
39 | is_apartment_building := True
40 | ensure then
41 | is_apartment_building: is_apartment_building and not is_villa and not is_skyscraper and not is_landmark
42 | end
43 |
44 | feature -- Constants
45 |
46 | default_width: REAL_64 = 27.0
47 | -- Default width of an apartment
48 |
49 | default_depth: REAL_64 = 13.0
50 | -- Default depth of an apartment
51 |
52 | default_height: REAL_64 = 35.0
53 | -- Default height of an apartment
54 |
55 | end
56 |
--------------------------------------------------------------------------------
/library/building/traffic_landmark.e:
--------------------------------------------------------------------------------
1 | note
2 | description:"Landmarks are special buildings with an image file or 3d model file for display"
3 | date: "$Date$"
4 | revision: "$Revision$"
5 |
6 | class
7 | TRAFFIC_LANDMARK
8 |
9 | inherit
10 |
11 | TRAFFIC_BUILDING
12 |
13 | create
14 | make
15 |
16 | feature {NONE} -- Initialization
17 |
18 | make (a_center: TRAFFIC_POINT; a_name: STRING; a_filename: STRING)
19 | -- Initialize with default size.
20 | require
21 | center_valid: a_center /= Void
22 | a_filename_exists: a_filename /= Void and then not a_filename.is_empty
23 | do
24 | filename := a_filename
25 | make_new (default_width, default_depth, default_height, a_center)
26 | is_landmark := True
27 | name := a_name
28 | ensure
29 | is_landmark: is_landmark and not is_apartment_building and not is_skyscraper and not is_villa
30 | size_set: width = default_width and height = default_height and depth = default_depth
31 | center_set: center = a_center
32 | filename_set: filename.is_equal (a_filename)
33 | end
34 |
35 | feature -- Access
36 |
37 | filename: STRING
38 | -- Filename for special display object
39 |
40 | name: STRING
41 | -- Name of the landmark
42 |
43 | feature -- Constants
44 |
45 | default_width: REAL_64 = 27.0
46 | -- Default width of a landmark building
47 |
48 | default_depth: REAL_64 = 13.0
49 | -- Default depth of a landmark building
50 |
51 | default_height: REAL_64 = 35.0
52 | -- Default height of a landmark building
53 |
54 | end
55 |
--------------------------------------------------------------------------------
/library/building/traffic_skyscraper.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "Skyscraper buildings"
3 | date: "$Date$"
4 | revision: "$Revision$"
5 |
6 | class
7 | TRAFFIC_SKYSCRAPER
8 |
9 | inherit
10 |
11 | TRAFFIC_BUILDING
12 | redefine
13 | make_new
14 | end
15 |
16 | create
17 |
18 | make_new, make_default
19 |
20 | feature {NONE} -- Initialization
21 |
22 | make_default (a_center: TRAFFIC_POINT)
23 | -- Initialize with default size.
24 | require
25 | center_valid: a_center /= Void
26 | do
27 | make_new (default_width, default_depth, default_height, a_center)
28 | ensure
29 | is_skyscraper: is_skyscraper and not is_villa and not is_apartment_building and not is_landmark
30 | size_set: width = default_width and height = default_height and depth = default_depth
31 | center_set: center = a_center
32 | end
33 |
34 | make_new (a_width, a_depth, a_height: REAL_64; a_center: TRAFFIC_POINT)
35 | -- Initialize with size.
36 | do
37 | Precursor (a_width, a_depth, a_height, a_center)
38 | is_skyscraper := True
39 | ensure then
40 | is_skyscraper: is_skyscraper and not is_villa and not is_apartment_building and not is_landmark
41 | end
42 |
43 | feature -- Constants
44 |
45 | default_width: REAL_64 = 33.0
46 | -- Default width of a skyscrapter
47 |
48 | default_depth: REAL_64 = 33.0
49 | -- Default depth of a skyscrapter
50 |
51 | default_height: REAL_64 = 81.0
52 | -- Default height of a skyscrapter
53 |
54 | end
55 |
--------------------------------------------------------------------------------
/library/building/traffic_villa.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "Single family houses"
3 | date: "$Date$"
4 | revision: "$Revision$"
5 |
6 | class
7 | TRAFFIC_VILLA
8 |
9 | inherit
10 |
11 | TRAFFIC_BUILDING
12 | redefine
13 | make_new
14 | end
15 |
16 | create
17 |
18 | make_new, make_default
19 |
20 | feature {NONE} -- Initialization
21 |
22 | make_default (a_center: TRAFFIC_POINT)
23 | -- Initialize with default size.
24 | require
25 | center_valid: a_center /= Void
26 | do
27 | make_new (default_width, default_depth, default_height, a_center)
28 | ensure
29 | is_villa: is_villa and not is_apartment_building and not is_skyscraper and not is_landmark
30 | size_set: width = default_width and height = default_height and depth = default_depth
31 | center_set: center = a_center
32 | end
33 |
34 | make_new (a_width, a_depth, a_height: REAL_64; a_center: TRAFFIC_POINT)
35 | -- Initialize with size.
36 | do
37 | Precursor (a_width, a_depth, a_height, a_center)
38 | is_villa := True
39 | ensure then
40 | is_villa: is_villa and not is_apartment_building and not is_skyscraper and not is_landmark
41 | end
42 |
43 | feature -- Constants
44 |
45 | default_width: REAL_64 = 18.0
46 | -- Default width of a villa
47 |
48 | default_depth: REAL_64 = 16.0
49 | -- Default depth of a villa
50 |
51 | default_height: REAL_64 = 9.3
52 | -- Default height of a villa
53 |
54 | end
55 |
--------------------------------------------------------------------------------
/library/input/traffic_building_parser.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "Parser for XML building files"
3 | date: "$Date$"
4 | revision: "$Revision$"
5 |
6 | class
7 | TRAFFIC_BUILDING_PARSER
8 |
9 | obsolete "Needs reworking"
10 |
11 | inherit
12 | TRAFFIC_XML_INPUT_FILE_PARSER
13 |
14 | TRAFFIC_NODE_PROCESSOR_REGISTRY
15 |
16 | create
17 | make_with_city
18 |
19 | feature -- Initialization
20 |
21 | make_with_city (a_city:TRAFFIC_CITY)
22 | -- Create parser.
23 |
24 | require
25 | city_valid: a_city /= void
26 | do
27 | make
28 | from
29 | Processor_registry.start
30 | until
31 | Processor_registry.off
32 | loop
33 | -- Processor_registry.item_for_iteration.set_city(a_city)
34 | Processor_registry.forth
35 | end
36 | end
37 |
38 | feature -- Status report
39 |
40 | can_process: BOOLEAN
41 | -- Can document tree be processed?
42 |
43 | do
44 | Result := is_parsed and then has_processor (root_element.name)
45 | end
46 |
47 | feature -- Basic operations
48 |
49 | process
50 | -- Process document tree.
51 | local
52 | p: TRAFFIC_NODE_PROCESSOR
53 | do
54 | p := processor (root_element.name)
55 | p.set_source (root_element)
56 | if p.has_error then
57 | set_error (p.error_code, p.slots)
58 | is_parsed := False
59 | end
60 | if not has_error then
61 | p.process
62 | if p.has_error then
63 | set_error (p.error_code, p.slots)
64 | is_parsed := False
65 | end
66 | end
67 | end
68 | end
69 |
--------------------------------------------------------------------------------
/library/input/traffic_buildings_node_processor.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "XML processors for nodes."
3 | date: "$Date$"
4 | revision: "$Revision$"
5 |
6 | class
7 | TRAFFIC_BUILDINGS_NODE_PROCESSOR
8 |
9 | obsolete "Needs reworking"
10 |
11 | inherit
12 | TRAFFIC_NODE_PROCESSOR
13 |
14 | create
15 | make
16 |
17 | feature -- Access
18 |
19 | Name: STRING = "buildings"
20 | -- Name of node to process
21 |
22 | Mandatory_attributes: ARRAY [STRING]
23 | -- Table of mandatory attributes
24 | once
25 | Result := << >>
26 | Result.compare_objects
27 | end
28 |
29 | feature -- Basic operations
30 |
31 | process
32 | -- Process node.
33 | do
34 | if has_subnodes then
35 | process_subnodes
36 | end
37 | end
38 |
39 | end
40 |
--------------------------------------------------------------------------------
/library/input/traffic_color_node_processor.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "XML processors for elements."
3 | date: "$Date: 2007-09-24 11:12:13 +0200 (Пн, 24 сен 2007) $"
4 | revision: "$Revision: 931 $"
5 |
6 | class
7 | TRAFFIC_COLOR_NODE_PROCESSOR
8 |
9 | inherit
10 | TRAFFIC_NODE_PROCESSOR
11 |
12 | create
13 | make
14 |
15 | feature -- Access
16 |
17 | Name: STRING = "color"
18 | -- Name of element to process
19 |
20 | Mandatory_attributes: ARRAY [STRING]
21 | -- Table of mandatory attributes
22 | once
23 | Result := << "red", "green", "blue" >>
24 | Result.compare_objects
25 | end
26 |
27 | feature -- Basic operations
28 |
29 | process
30 | -- Process element.
31 | do
32 | if not has_attribute ("red") and has_attribute ("green") and has_attribute ("blue") then
33 | set_error (Mandatory_attribute_missing, << "color attribute missing" >>)
34 | elseif not valid_color then
35 | set_error (Wrong_color_value, << >>)
36 | else
37 | parent.send_data (new_color)
38 | end
39 | end
40 |
41 | feature {NONE} -- Implementation
42 |
43 | valid_color: BOOLEAN
44 | -- Does node contain a valid color?
45 | require
46 | red_exists: has_attribute ("red")
47 | green_exists: has_attribute ("green")
48 | blue_exists: has_attribute ("blue")
49 | do
50 | Result := valid_color_value ("red") and
51 | valid_color_value ("green") and
52 | valid_color_value ("blue")
53 | end
54 |
55 | valid_color_value (attr: STRING): BOOLEAN
56 | -- Does attribute `attr' contain a valid color value?
57 | require
58 | attribute_exists: attr /= Void
59 | attribute_not_empty: not attr.is_empty
60 | local
61 | v: INTEGER
62 | do
63 | if is_attribute_integer (attr) then
64 | v := attribute_integer (attr)
65 | Result := 0 <= v and v <= 255
66 | end
67 | end
68 |
69 | new_color: TRAFFIC_COLOR
70 | -- Color specified by node
71 | require
72 | valid_color: valid_color
73 | do
74 | create Result.make_with_rgb (
75 | attribute_integer ("red"),
76 | attribute_integer ("green"),
77 | attribute_integer ("blue"))
78 | ensure
79 | Result_exists: Result /= Void
80 | end
81 |
82 | end
83 |
--------------------------------------------------------------------------------
/library/input/traffic_description_node_processor.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "XML processors for nodes."
3 | date: "$Date: 2009-04-06 14:42:41 +0200 (Пн, 06 апр 2009) $"
4 | revision: "$Revision: 1086 $"
5 |
6 | class
7 | TRAFFIC_DESCRIPTION_NODE_PROCESSOR
8 |
9 | inherit
10 | TRAFFIC_NODE_PROCESSOR
11 |
12 | create
13 | make
14 |
15 | feature -- Access
16 |
17 | Name: STRING = "description"
18 | -- Name of node to process
19 |
20 | Mandatory_attributes: ARRAY [STRING]
21 | -- Table of mandatory attributes
22 | do
23 | Result := << "text" >>
24 | Result.compare_objects
25 | end
26 |
27 | feature -- Basic operations
28 |
29 | process
30 | -- Process element.
31 | require else
32 | has_target: has_target -- Because it has been passed down from the parent.
33 | local
34 | description: STRING
35 | do
36 | if has_attribute ("text") then
37 | create description.make_from_string (xml_attribute ("text"))
38 | parent.send_data (description)
39 | else
40 | set_error (Mandatory_attribute_missing, << "text" >>)
41 | end
42 | end
43 |
44 | end
45 |
--------------------------------------------------------------------------------
/library/input/traffic_file_node_processor.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "XML processors for background elements."
3 | date: "$Date: 2009-04-06 14:42:41 +0200 (Пн, 06 апр 2009) $"
4 | revision: "$Revision: 1086 $"
5 |
6 | class
7 | TRAFFIC_FILE_NODE_PROCESSOR
8 |
9 | inherit
10 | TRAFFIC_NODE_PROCESSOR
11 |
12 | create
13 | make
14 |
15 | feature -- Access
16 |
17 | Name: STRING = "file"
18 | -- Name of element to process
19 |
20 | Mandatory_attributes: ARRAY [STRING]
21 | -- Table of mandatory attributes
22 | once
23 | Result := << "name" >>
24 | Result.compare_objects
25 | end
26 |
27 | feature -- Basic operations
28 |
29 | process
30 | -- Process node.
31 | do
32 | if has_attribute ("name") then
33 | create file.make_from_string (xml_attribute ("name"))
34 | -- parent.send_data (file)
35 | else
36 | set_error (Mandatory_attribute_missing, << "name" >>)
37 | end
38 | end
39 |
40 | file: STRING
41 | -- String in which the filename is stored
42 |
43 | end
44 |
--------------------------------------------------------------------------------
/library/input/traffic_lines_node_processor.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "XML processors for nodes."
3 | date: "$Date: 2007-09-24 11:12:13 +0200 (Пн, 24 сен 2007) $"
4 | revision: "$Revision: 931 $"
5 |
6 | class
7 | TRAFFIC_LINES_NODE_PROCESSOR
8 |
9 | inherit
10 | TRAFFIC_NODE_PROCESSOR
11 |
12 | create
13 | make
14 |
15 | feature -- Access
16 |
17 | Name: STRING = "lines"
18 | -- Name of node to process
19 |
20 | Mandatory_attributes: ARRAY [STRING]
21 | -- Table of mandatory attributes
22 | once
23 | Result := << >>
24 | Result.compare_objects
25 | end
26 |
27 | feature -- Basic operations
28 |
29 | process
30 | -- Process node.
31 | do
32 | if has_subnodes then
33 | process_subnodes
34 | end
35 | end
36 |
37 | end
38 |
--------------------------------------------------------------------------------
/library/input/traffic_map_node_processor.e:
--------------------------------------------------------------------------------
1 | note
2 | description: "XML processors for