├── .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 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 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 nodes." 3 | date: "$Date: 2009-08-21 13:35:22 +0200 (Пт, 21 авг 2009) $" 4 | revision: "$Revision: 1098 $" 5 | 6 | class 7 | TRAFFIC_MAP_NODE_PROCESSOR 8 | 9 | inherit 10 | TRAFFIC_NODE_PROCESSOR 11 | 12 | create 13 | make 14 | 15 | feature -- Access 16 | 17 | Name: STRING = "map" 18 | -- Name of node to process 19 | 20 | Mandatory_attributes: ARRAY [STRING] 21 | -- Table of mandatory attributes 22 | once 23 | Result := << "name", "scale_factor", "center_x", "center_y", "radius" >> 24 | Result.compare_objects 25 | end 26 | 27 | feature -- Basic operations 28 | 29 | process 30 | -- Process node. 31 | local 32 | description: STRING 33 | do 34 | if has_attribute ("name") then 35 | map_factory.build_city (xml_attribute ("name")) 36 | end 37 | 38 | if has_attribute ("scale_factor") then 39 | if not xml_attribute ("scale_factor").is_double then 40 | set_error (wrong_attribute_type, << "scale_factor" >>) 41 | end 42 | city.set_scale_factor (xml_attribute ("scale_factor").to_double) 43 | end 44 | 45 | if has_attribute ("center_x") and has_attribute ("center_y") and has_attribute ("radius") then 46 | if not xml_attribute ("center_x").is_double then 47 | set_error (wrong_attribute_type, << "center_x" >>) 48 | end 49 | if not xml_attribute ("center_y").is_double then 50 | set_error (wrong_attribute_type, << "center_y" >>) 51 | end 52 | if not xml_attribute ("radius").is_double then 53 | set_error (wrong_attribute_type, << "radius" >>) 54 | end 55 | if not has_error then 56 | city.set_center (create {TRAFFIC_POINT}.make (attribute_double ("center_x"), attribute_double ("center_y"))) 57 | city.set_radius (attribute_double ("radius")) 58 | end 59 | 60 | end 61 | 62 | if has_subnodes then 63 | process_subnodes 64 | end 65 | description ?= data 66 | if not has_error and description /= Void then 67 | map_factory.city.set_description (description) 68 | end 69 | end 70 | 71 | end 72 | -------------------------------------------------------------------------------- /library/input/traffic_map_parser.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "XML parser for the traffic map data." 3 | date: "$Date: 2007-09-24 11:12:13 +0200 (Пн, 24 сен 2007) $" 4 | revision: "$Revision: 931 $" 5 | 6 | class 7 | TRAFFIC_MAP_PARSER 8 | 9 | inherit 10 | 11 | TRAFFIC_XML_INPUT_FILE_PARSER 12 | 13 | TRAFFIC_NODE_PROCESSOR_REGISTRY 14 | 15 | create 16 | make_with_factory 17 | 18 | feature -- Initialization 19 | 20 | make_with_factory (a_traffic_map_factory: TRAFFIC_MAP_FACTORY) 21 | -- Create parser with `a_traffic_map_factory'. 22 | require 23 | a_traffic_map_factory_exists: a_traffic_map_factory /= Void 24 | do 25 | make 26 | from 27 | Processor_registry.start 28 | until 29 | Processor_registry.off 30 | loop 31 | Processor_registry.item_for_iteration.set_map_factory (a_traffic_map_factory) 32 | Processor_registry.forth 33 | end 34 | end 35 | 36 | feature -- Status report 37 | 38 | can_process: BOOLEAN 39 | -- Can document tree be processed? 40 | do 41 | Result := is_parsed and then has_processor (root_element.name) 42 | end 43 | 44 | feature -- Basic operations 45 | 46 | process 47 | -- Process document tree. 48 | local 49 | p: TRAFFIC_NODE_PROCESSOR 50 | do 51 | p := processor (root_element.name) 52 | p.set_source (root_element) 53 | if p.has_error then 54 | set_error (p.error_code, p.slots) 55 | is_parsed := False 56 | end 57 | if not has_error then 58 | p.process 59 | if p.has_error then 60 | set_error (p.error_code, p.slots) 61 | is_parsed := False 62 | end 63 | end 64 | set_map_factory (p.map_factory) 65 | end 66 | 67 | invariant 68 | 69 | can_process_definition: can_process = (is_parsed and 70 | has_processor (root_element.name)) 71 | 72 | end 73 | -------------------------------------------------------------------------------- /library/input/traffic_onroad_node_processor.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "XML processors for nodes." 3 | date: "$Date: 2007-07-24 11:47:24 +0200 (Tue, 24 Jul 2007) $" 4 | revision: "$Revision: 901 $" 5 | 6 | class 7 | TRAFFIC_ONROAD_NODE_PROCESSOR 8 | 9 | inherit 10 | TRAFFIC_NODE_PROCESSOR 11 | 12 | create 13 | make 14 | 15 | feature -- Access 16 | 17 | Name: STRING = "onroad" 18 | -- Name of node to process 19 | 20 | Mandatory_attributes: ARRAY [STRING] 21 | -- Table of mandatory attributes 22 | once 23 | Result := << "id", "back" >> 24 | Result.compare_objects 25 | end 26 | 27 | feature -- Basic operations 28 | 29 | process 30 | -- Process node. 31 | local 32 | a_city:TRAFFIC_CITY 33 | do 34 | if not has_attribute ("id") then 35 | set_error (Mandatory_attribute_missing, << "id" >>) 36 | else 37 | a_city:=map_factory.city 38 | -- retrieve the corresponding instance of TRAFFIC_ROAD 39 | if (a_city.roads.has (xml_attribute("id").to_integer)) and xml_attribute ("back").is_equal ("false") then 40 | parent.send_data (a_city.roads.item (xml_attribute("id").to_integer).one_way) 41 | elseif (a_city.roads.has (xml_attribute("id").to_integer)) and xml_attribute ("back").is_equal ("true") then 42 | parent.send_data (a_city.roads.item (xml_attribute("id").to_integer).other_way) 43 | else 44 | set_error(No_road_with_given_id_exists,<<"id">>) 45 | parent.send_data(Void) 46 | end 47 | end 48 | 49 | if not has_error and has_subnodes then 50 | process_subnodes 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /library/input/traffic_places_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_PLACES_NODE_PROCESSOR 8 | 9 | inherit 10 | TRAFFIC_NODE_PROCESSOR 11 | 12 | create 13 | make 14 | 15 | feature -- Access 16 | 17 | Name: STRING = "places" 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_point_node_processor.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | XML processors for elements. Example: . 4 | ]" 5 | date: "$Date: 2008-09-09 11:36:48 +0200 (Вт, 09 сен 2008) $" 6 | revision: "$Revision: 1070 $" 7 | 8 | class 9 | TRAFFIC_POINT_NODE_PROCESSOR 10 | 11 | inherit 12 | TRAFFIC_NODE_PROCESSOR 13 | 14 | create 15 | make 16 | 17 | feature -- Access 18 | 19 | Name: STRING = "point" 20 | -- Name of node to process 21 | 22 | Mandatory_attributes: ARRAY [STRING] 23 | -- Table of mandatory attributes 24 | once 25 | Result := << "x", "y" >> 26 | Result.compare_objects 27 | end 28 | 29 | feature -- Basic operations 30 | 31 | process 32 | -- Process node. 33 | local 34 | x: INTEGER 35 | y: INTEGER 36 | p: TRAFFIC_POINT 37 | do 38 | if not has_attribute ("x") and has_attribute ("y") then 39 | set_error (Mandatory_attribute_missing, << "x", "y" >>) 40 | elseif not ((is_attribute_integer ("x") and is_attribute_integer ("y")) or 41 | (is_attribute_double ("x") and is_attribute_double ("y"))) 42 | then 43 | set_error (Wrong_attribute_type, << "x", "y" >>) 44 | else 45 | x := attribute_integer ("x") 46 | y := attribute_integer ("y") 47 | create p.make(x, y) 48 | parent.send_data (p) 49 | end 50 | end 51 | 52 | end 53 | -------------------------------------------------------------------------------- /library/input/traffic_roads_node_processor.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "XML processors for elements." 3 | date: "$Date: 2007-07-24 11:47:24 +0200 (Tue, 24 Jul 2007) $" 4 | revision: "$Revision: 901 $" 5 | 6 | class 7 | TRAFFIC_ROADS_NODE_PROCESSOR 8 | 9 | inherit 10 | TRAFFIC_NODE_PROCESSOR 11 | 12 | create 13 | make 14 | 15 | feature -- Access 16 | 17 | Name: STRING = "roads" 18 | -- Name of node to process 19 | 20 | Mandatory_attributes: ARRAY [STRING] 21 | -- Table of mandatory attributes 22 | once 23 | Result := {ARRAY [STRING]}<< >> 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/moving/traffic_bus.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Vehicles of type bus" 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_BUS 8 | 9 | inherit 10 | TRAFFIC_LINE_VEHICLE 11 | 12 | create 13 | make_with_line 14 | 15 | feature -- Initialization 16 | 17 | make_with_line (a_line: TRAFFIC_LINE) 18 | -- Create a bus following `a_line'. 19 | -- Set unit_capacity and speed to default values. 20 | require 21 | a_line_exists: a_line /= Void 22 | valid_line: is_valid_line (a_line) 23 | do 24 | set_line (a_line) 25 | speed := Default_virtual_speed 26 | unit_capacity := Default_capacity 27 | create changed_event 28 | end 29 | 30 | feature -- Access 31 | 32 | count: INTEGER 33 | -- Current amount of load 34 | 35 | feature -- Basic operations 36 | 37 | replace (a_line: TRAFFIC_LINE) 38 | -- Serve as replacement bus for `a_line'. 39 | require 40 | a_line_not_void: a_line /= void 41 | do 42 | set_line (a_line) 43 | changed_event.publish ([]) 44 | ensure 45 | new_line_set: line = a_line 46 | end 47 | 48 | load(a_quantity: INTEGER) 49 | -- Load cargo or a passenger. 50 | do 51 | count := count + a_quantity 52 | end 53 | 54 | unload(a_quantity: INTEGER) 55 | -- Load cargo or a passenger. 56 | do 57 | count := count - a_quantity 58 | end 59 | 60 | feature-- Constants 61 | 62 | Default_capacity: INTEGER = 180 63 | -- Default capacity of a bus 64 | 65 | Default_virtual_speed: REAL_64 66 | -- Default speed of a bus 67 | do 68 | Result := line.type.speed 69 | end 70 | 71 | feature -- Status report 72 | 73 | is_insertable (a_city: TRAFFIC_CITY): BOOLEAN 74 | -- Is `Current' insertable into `a_city'? 75 | do 76 | Result := True 77 | end 78 | 79 | is_removable: BOOLEAN 80 | -- Is `Current' removable from `a_city'? 81 | do 82 | Result := True 83 | end 84 | 85 | is_valid_line (a_line: TRAFFIC_LINE): BOOLEAN 86 | -- Is `a_line' valid for a tram to move on? 87 | do 88 | if a_line.type.is_equal (create {TRAFFIC_TYPE_TRAM}.make) or a_line.type.is_equal (create {TRAFFIC_TYPE_BUS}.make) then 89 | Result := True 90 | end 91 | end 92 | 93 | end 94 | -------------------------------------------------------------------------------- /library/moving/traffic_cablecar.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Vehicles of type cablecar" 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_CABLECAR 8 | 9 | obsolete "Not yet implemented" 10 | 11 | inherit 12 | TRAFFIC_TRAM 13 | 14 | invariant 15 | 16 | wagon_limited: wagon_limitation = 0 17 | 18 | end 19 | 20 | -------------------------------------------------------------------------------- /library/moving/traffic_free_moving.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Objects that can move around the city freely (do not need to travel on streets)" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_FREE_MOVING 8 | 9 | inherit 10 | 11 | TRAFFIC_MOVING 12 | 13 | create 14 | make_with_points 15 | 16 | feature -- Initialization 17 | 18 | make_with_points (a_list: DS_ARRAYED_LIST [TRAFFIC_POINT]; a_speed: REAL_64) 19 | -- Set passengers route as `a_list' and speed to `a_speed' (in m/s). 20 | -- `a_list' is the list of the points where the passenger will go through. 21 | require 22 | a_list_not_void: a_list /= Void 23 | a_speed_not_negative: a_speed >= 0 24 | do 25 | create poly_cursor.make (a_list) 26 | poly_cursor.start 27 | location := poly_cursor.item 28 | move_next 29 | update_angle 30 | speed := a_speed 31 | create changed_event 32 | end 33 | 34 | 35 | feature -- Status report 36 | 37 | is_insertable (a_city: TRAFFIC_CITY): BOOLEAN 38 | -- Is `Current' insertable into `a_city'? 39 | do 40 | Result := True 41 | end 42 | 43 | is_removable: BOOLEAN 44 | -- Is `Current' removable from `a_city'? 45 | do 46 | Result := True 47 | end 48 | 49 | feature {NONE} --Implementation 50 | 51 | move_next 52 | -- Move to following position 53 | do 54 | -- Set the locations to the corresponding ones of the line segment. 55 | origin := poly_cursor.item 56 | location := poly_cursor.item 57 | if is_traveling_back then 58 | poly_cursor.back 59 | if poly_cursor.before then 60 | is_traveling_back := False 61 | poly_cursor.forth 62 | move_next 63 | else 64 | destination := poly_cursor.item 65 | end 66 | elseif is_reiterating then 67 | poly_cursor.forth 68 | if poly_cursor.after then 69 | is_traveling_back := True 70 | poly_cursor.back 71 | move_next 72 | else 73 | destination := poly_cursor.item 74 | end 75 | else 76 | poly_cursor.forth 77 | if poly_cursor.after then 78 | has_finished := True 79 | else 80 | destination := poly_cursor.item 81 | end 82 | end 83 | end 84 | 85 | 86 | end 87 | -------------------------------------------------------------------------------- /library/moving/traffic_moving.e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/library/moving/traffic_moving.e -------------------------------------------------------------------------------- /library/moving/traffic_train.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Trains" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_TRAIN 8 | 9 | obsolete "Not yet implemented" 10 | 11 | end 12 | -------------------------------------------------------------------------------- /library/moving/traffic_trolley.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Trolleys (not yet included in the city)" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_TROLLEY 8 | 9 | inherit 10 | 11 | TRAFFIC_TRAM 12 | undefine 13 | is_valid_line, 14 | is_insertable, 15 | is_removable, 16 | count, 17 | load, 18 | unload 19 | select 20 | capacity, 21 | engine_capacity 22 | end 23 | 24 | TRAFFIC_BUS 25 | rename 26 | unit_capacity as bus_unit_capacity, 27 | Default_virtual_speed as bus_speed, 28 | capacity as bus_capacity 29 | undefine 30 | make_with_line 31 | end 32 | 33 | end 34 | -------------------------------------------------------------------------------- /library/moving/traffic_vehicle.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Deferred class for objects that can be used to transport cargo or passengers" 3 | date: "$Date: 2006/06/06 12:23:40 $" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_VEHICLE 8 | 9 | inherit 10 | TRAFFIC_MOVING 11 | 12 | feature --Access 13 | 14 | count: INTEGER 15 | -- Current amount of load 16 | deferred 17 | end 18 | 19 | capacity:INTEGER 20 | -- Maximum possible load 21 | do 22 | Result := unit_capacity 23 | end 24 | 25 | feature -- Basic operations 26 | 27 | load(a_quantity: INTEGER) 28 | -- Load cargo or a passenger. 29 | require 30 | a_quantity_non_negative: a_quantity >= 0 31 | valid_quantity: capacity >= count + a_quantity 32 | deferred 33 | ensure 34 | loaded: count = old count + a_quantity 35 | end 36 | 37 | unload(a_quantity: INTEGER) 38 | -- Unload cargo or a passenger. 39 | require 40 | a_quantity_non_negative: a_quantity >= 0 41 | valid_quantity: count >= a_quantity 42 | deferred 43 | ensure 44 | unloaded: count = old count - a_quantity 45 | end 46 | 47 | feature{NONE} -- Implementation 48 | 49 | unit_capacity: INTEGER 50 | -- Maximum load this vehicle unit can carry 51 | 52 | invariant 53 | not_too_small: count >= 0 54 | not_too_large: count <= capacity 55 | unit_capacity_non_negative: unit_capacity >= 0 56 | end 57 | -------------------------------------------------------------------------------- /library/moving/traffic_wagon.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Wagon objects can be used to increase the capacity of trams." 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_WAGON 8 | 9 | create 10 | make_default 11 | 12 | feature -- Initialization 13 | 14 | make_default 15 | -- Set capacity to Default_capacity 16 | do 17 | capacity := Default_capacity 18 | end 19 | 20 | feature -- Basic operations 21 | 22 | load (a_quantity: INTEGER) 23 | -- load `a_quantity' of passengers in the vagon 24 | require 25 | valid_quantity: a_quantity > 0 26 | not_too_much: count + a_quantity <= capacity 27 | do 28 | count := count + a_quantity 29 | ensure 30 | loaded: count = old count + a_quantity 31 | end 32 | 33 | unload (a_quantity: INTEGER) 34 | -- load `a_quantity' of passengers in the vagon 35 | require 36 | valid_quantity: a_quantity > 0 37 | not_too_much: count - a_quantity >= 0 38 | do 39 | count := count + a_quantity 40 | ensure 41 | loaded: count = old count - a_quantity 42 | end 43 | 44 | feature --Access 45 | 46 | capacity: INTEGER 47 | -- Load allowed 48 | 49 | count: INTEGER 50 | -- number of passengers 51 | 52 | feature --Constants 53 | 54 | Default_capacity: INTEGER = 100 55 | -- Default capacity 56 | 57 | invariant 58 | capacity >= 0 59 | not_to_many: count <= capacity 60 | not_to_few: count >= 0 61 | end 62 | 63 | -------------------------------------------------------------------------------- /library/structure/container/traffic_event_container.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Superclass of containers that throw events when elements are added or removed" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_EVENT_CONTAINER [G] 8 | 9 | feature -- Access 10 | 11 | element_inserted_event: TRAFFIC_EVENT_CHANNEL [TUPLE [G]] 12 | -- Insertion event ([Inserted element]) 13 | 14 | element_removed_event: TRAFFIC_EVENT_CHANNEL [TUPLE [G]] 15 | -- Deletion event ([Removed element]) 16 | 17 | invariant 18 | 19 | inserted_initialized: element_inserted_event /= Void 20 | removed_initialized: element_removed_event /= Void 21 | 22 | end 23 | -------------------------------------------------------------------------------- /library/structure/graph/dispenser/inverse_heap_priority_queue.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | Heap priority queue sorted such that the item with the lowest 4 | priority is placed at the head of the queue. 5 | ]" 6 | author: "Olivier Jeger" 7 | date: "$Date: 2010-06-28 20:14:26 +0200 (Пн, 28 июн 2010) $" 8 | revision: "$Revision: 1133 $" 9 | 10 | class 11 | INVERSE_HEAP_PRIORITY_QUEUE [G -> COMPARABLE] 12 | 13 | inherit 14 | HEAP_PRIORITY_QUEUE [G] 15 | redefine 16 | safe_less_than 17 | end 18 | 19 | create 20 | make 21 | 22 | feature {NONE} -- Comparison 23 | 24 | safe_less_than (a, b: G): BOOLEAN 25 | -- Same as `a > b' when `a' and `b' are not Void. 26 | -- If `b' is Void and `a' is not, then True 27 | -- Otherwise False 28 | do 29 | if a /= Void and b /= Void then 30 | Result := a > b 31 | elseif a /= Void and b = Void then 32 | Result := True 33 | else 34 | Result := False 35 | end 36 | end 37 | 38 | end 39 | -------------------------------------------------------------------------------- /library/structure/graph/graph/implementation/linked_graph/linked_graph_node.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | Graph nodes used for the LINKED_GRAPH data structure. 4 | ]" 5 | author: "Olivier Jeger" 6 | license: "Eiffel Forum License v2 (see forum.txt)" 7 | date: "$Date: 2007-05-10 15:15:34 +0200 (Чт, 10 май 2007) $" 8 | revision: "$Revision: 887 $" 9 | 10 | class 11 | LINKED_GRAPH_NODE [G -> HASHABLE, L] 12 | 13 | inherit 14 | NODE [G, L] 15 | redefine 16 | make, 17 | item 18 | end 19 | 20 | create 21 | make 22 | 23 | feature {NONE} -- Initialization 24 | 25 | make (a_item: G) 26 | -- Make a new linked graph node. 27 | do 28 | Precursor (a_item) 29 | create edge_list.make 30 | ensure then 31 | no_neighbors: edge_list.is_empty 32 | end 33 | 34 | feature -- Access 35 | 36 | item: G 37 | -- Item value 38 | 39 | feature {LINKED_GRAPH} -- Access 40 | 41 | edge_list: TWO_WAY_CIRCULAR [LINKED_GRAPH_EDGE [G, L]] 42 | -- List of all incident edges. 43 | 44 | feature -- Measurement 45 | 46 | out_degree: INTEGER 47 | -- Number of outgoing edges of `item' 48 | do 49 | Result := edge_list.count 50 | end 51 | 52 | feature -- Cursor movement 53 | 54 | turn_to (a_node: LINKED_GRAPH_NODE [G, L]) 55 | -- Turn to the edge where `a_node' is the opposite node. 56 | require 57 | node_not_void: a_node /= Void 58 | local 59 | found: BOOLEAN 60 | do 61 | from 62 | edge_list.start 63 | until 64 | found or edge_list.after 65 | loop 66 | if edge_list.item.internal_end_node = a_node then 67 | found := True 68 | else 69 | edge_list.forth 70 | end 71 | end 72 | end 73 | 74 | feature -- Element change 75 | 76 | put_edge (a_edge: LINKED_GRAPH_EDGE [G, L]) 77 | -- 78 | require 79 | incident_node: item = a_edge.start_node or item = a_edge.end_node 80 | do 81 | edge_list.extend (a_edge) 82 | ensure 83 | edge_inserted: edge_list.has (a_edge) 84 | increased_degree: out_degree = old out_degree + 1 85 | end 86 | 87 | invariant 88 | 89 | item_not_void: item /= Void 90 | 91 | end -- class LINKED_GRAPH_NODE 92 | -------------------------------------------------------------------------------- /library/structure/graph/graph/implementation/linked_graph/linked_graph_weighted_edge.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | Weighted graph edges used for the LINKED_GRAPH data structure. 4 | ]" 5 | author: "Olivier Jeger" 6 | license: "Eiffel Forum License v2 (see forum.txt)" 7 | date: "$Date: 2010-06-28 20:14:26 +0200 (Пн, 28 июн 2010) $" 8 | revision: "$Revision: 1133 $" 9 | 10 | class 11 | LINKED_GRAPH_WEIGHTED_EDGE [G -> HASHABLE, L] 12 | 13 | inherit 14 | WEIGHTED_EDGE [G, L] 15 | rename 16 | make_directed as weighted_edge_make_directed, 17 | make_undirected as weighted_edge_make_undirected 18 | export {NONE} 19 | weighted_edge_make_directed, 20 | weighted_edge_make_undirected 21 | end 22 | 23 | LINKED_GRAPH_EDGE [G, L] 24 | rename 25 | make_directed as unweighted_make_directed, 26 | make_undirected as unweighted_make_undirected 27 | export {NONE} 28 | unweighted_make_directed, 29 | unweighted_make_undirected 30 | undefine 31 | is_equal, 32 | out 33 | end 34 | 35 | create 36 | make_directed, make_undirected 37 | 38 | feature {NONE} -- Initialization 39 | 40 | make_directed (a_start_node, a_end_node: LINKED_GRAPH_NODE [G, L]; a_label: L; a_weight: REAL_64) 41 | -- Make a directed labeled edge from two nodes with weight `a_weight'. 42 | do 43 | unweighted_make_directed (a_start_node, a_end_node, a_label) 44 | user_defined_weight_function := False 45 | internal_weight := a_weight 46 | ensure then 47 | weight_set: weight = a_weight 48 | default_weight_function: not user_defined_weight_function 49 | end 50 | 51 | make_undirected (a_start_node, a_end_node: LINKED_GRAPH_NODE [G, L]; a_label: L; a_weight: REAL_64) 52 | -- Make an undirected labeled edge from two nodes with weight `a_weight'. 53 | do 54 | unweighted_make_undirected (a_start_node, a_end_node, a_label) 55 | user_defined_weight_function := False 56 | internal_weight := a_weight 57 | ensure then 58 | weight_set: weight = a_weight 59 | default_weight_function: not user_defined_weight_function 60 | end 61 | 62 | end -- class LINKED_GRAPH_WEIGHTED_EDGE 63 | -------------------------------------------------------------------------------- /library/structure/graph/graph/structure/graph_cursor.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | Cursors for remembering positions in graphs. 4 | ]" 5 | author: "Olivier Jeger" 6 | license: "Eiffel Forum License v2 (see forum.txt)" 7 | date: "$Date: 2005-05-25 15:06:13 +0200 (Ср, 25 май 2005) $" 8 | revision: "$Revision: 2 $" 9 | 10 | class 11 | GRAPH_CURSOR [G -> HASHABLE, L] 12 | 13 | inherit 14 | CURSOR 15 | 16 | create 17 | make 18 | 19 | feature {NONE} -- Initialization 20 | 21 | make (a_node: G; a_edge: EDGE [G, L]) 22 | -- Create a cursor for with attributes `a_node' and `a_edge'. 23 | require 24 | no_edge_when_off: (a_node = Void) implies (a_edge = Void) 25 | do 26 | current_node := a_node 27 | edge_item := a_edge 28 | ensure 29 | node_assigned: current_node = a_node 30 | edge_assigned: edge_item = a_edge 31 | end 32 | 33 | feature {GRAPH} -- Access 34 | 35 | current_node: G 36 | -- Node at the current cursor position 37 | 38 | edge_item: EDGE [G, L] 39 | -- Edge which is currently focused 40 | 41 | invariant 42 | 43 | no_edge_when_off: (current_node = Void) implies (edge_item = Void) 44 | 45 | end -- class GRAPH_CURSOR 46 | -------------------------------------------------------------------------------- /library/structure/graph/graph/walker/bfs_walker.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | The BFS walker is a LINEAR abstraction of a graph, that starts 4 | on a specific node and will walk in a breadth first search order 5 | over the graph nodes. 6 | The cursor of the graph will be moved accordingly. 7 | 8 | Warning: The graph must not be changed in it's structure during 9 | walking. 10 | ]" 11 | author: "Olivier Jeger, based on an initial design by Bernd Schoeller" 12 | license: "Eiffel Forum License v2 (see forum.txt)" 13 | date: "$Date: 2009-04-06 14:42:41 +0200 (Пн, 06 апр 2009) $" 14 | revision: "$Revision: 1086 $" 15 | 16 | class 17 | BFS_WALKER [G -> HASHABLE, reference L] 18 | 19 | inherit 20 | ABSTRACT_FS_WALKER [G, L] 21 | 22 | ITERATION_CURSOR [G] 23 | 24 | create 25 | make 26 | 27 | feature -- Initialize 28 | 29 | create_dispenser 30 | -- Create the dispenser as a queue for the BFS 31 | do 32 | create {LINKED_QUEUE [GRAPH_CURSOR [G,L]]} dispenser.make 33 | end 34 | 35 | feature -- New Cursor 36 | 37 | new_cursor: BFS_WALKER [G, L] 38 | do 39 | Result := twin 40 | Result.start 41 | end 42 | 43 | end -- class BFS_WALKER 44 | -------------------------------------------------------------------------------- /library/structure/graph/graph/walker/dfs_walker.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | The DFS walker is a LINEAR abstraction of a graph, that starts 4 | on a specific node and will walk in a depth first search order 5 | over the graph nodes. 6 | The cursor of the graph will be moved accordingly. 7 | 8 | Warning: The graph must not be changed in it's structure during 9 | walking. 10 | ]" 11 | author: "Olivier Jeger, based on an initial design by Bernd Schoeller" 12 | license: "Eiffel Forum License v2 (see forum.txt)" 13 | date: "$Date: 2009-04-06 14:42:41 +0200 (Пн, 06 апр 2009) $" 14 | revision: "$Revision: 1086 $" 15 | 16 | class 17 | DFS_WALKER [G -> HASHABLE, reference L] 18 | 19 | inherit 20 | ABSTRACT_FS_WALKER [G, L] 21 | 22 | ITERATION_CURSOR [G] 23 | 24 | 25 | create 26 | make 27 | 28 | feature -- Initialize 29 | 30 | create_dispenser 31 | -- Create the dispenser for a DFS walker 32 | do 33 | create {LINKED_STACK [GRAPH_CURSOR[G, L]]} dispenser.make 34 | end 35 | 36 | 37 | feature -- New Cursor 38 | 39 | new_cursor: DFS_WALKER [G, L] 40 | do 41 | Result := twin 42 | Result.start 43 | end 44 | 45 | end -- class DFS_WALKER 46 | -------------------------------------------------------------------------------- /library/traffic_city_item.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Elements that belong to the city" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_CITY_ITEM 8 | 9 | feature -- Status report 10 | 11 | is_in_city: BOOLEAN 12 | -- Is `Current' a member of the city? 13 | 14 | feature {TRAFFIC_EVENT_CONTAINER} -- Basic operations 15 | 16 | add_to_city (a_city: TRAFFIC_CITY) 17 | -- Add `Current' to `a_city'. 18 | require 19 | a_city_exists: a_city /= Void 20 | not_in_city: not is_in_city 21 | insertable: is_insertable (a_city) 22 | do 23 | is_in_city := True 24 | city := a_city 25 | ensure 26 | is_in_city: is_in_city 27 | city_set: city = a_city 28 | end 29 | 30 | remove_from_city 31 | -- Remove `Current' from `city'. 32 | require 33 | is_in_city: is_in_city 34 | is_removable: is_removable 35 | do 36 | is_in_city := False 37 | city := Void 38 | ensure 39 | not_in_city: not is_in_city 40 | city_unset: city = Void 41 | end 42 | 43 | feature -- Status setting 44 | 45 | highlight 46 | -- Highlight. 47 | do 48 | is_highlighted := True 49 | changed_event.publish ([]) 50 | ensure 51 | highlighted: is_highlighted 52 | end 53 | 54 | unhighlight 55 | -- Unhighlight. 56 | do 57 | is_highlighted := False 58 | changed_event.publish ([]) 59 | ensure 60 | unhighlighted: not is_highlighted 61 | end 62 | 63 | feature -- Access 64 | 65 | city: TRAFFIC_CITY 66 | -- City to which the item belongs (may be void) 67 | 68 | changed_event: TRAFFIC_EVENT_CHANNEL [TUPLE []] 69 | -- Event to publish when `Current' changed 70 | 71 | feature -- Status report 72 | 73 | is_insertable (a_city: TRAFFIC_CITY): BOOLEAN 74 | -- Is `Current' insertable into `a_city'? 75 | -- E.g. are all needed elements already inserted in the city? 76 | deferred 77 | end 78 | 79 | is_removable: BOOLEAN 80 | -- Is `Current' removable from `city'? 81 | -- E.g. no other elements need it any more? 82 | deferred 83 | end 84 | 85 | is_highlighted: BOOLEAN 86 | -- Is `Current' highlighted? 87 | 88 | invariant 89 | 90 | changed_event_exists: changed_event /= Void 91 | 92 | end 93 | -------------------------------------------------------------------------------- /library/traffic_constants.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Constants for Traffic" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_CONSTANTS 8 | 9 | feature -- Constants 10 | 11 | Line_width: REAL_64 = 7.0 12 | -- Width of the line representation on the city 13 | 14 | end 15 | -------------------------------------------------------------------------------- /library/traffic_id_manager.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Manager for road ids" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_ID_MANAGER 8 | 9 | inherit 10 | ANY 11 | redefine 12 | default_create 13 | end 14 | 15 | feature -- Initialization 16 | 17 | default_create 18 | -- Create `id_list'. 19 | do 20 | create id_list.make_default 21 | ensure then 22 | id_list_created: id_list /= Void 23 | end 24 | 25 | feature -- Element change 26 | 27 | take (an_id: INTEGER) 28 | -- Set `an_id' to be taken. 29 | do 30 | id_list.force (True, an_id) 31 | ensure 32 | is_taken: is_taken (an_id) 33 | end 34 | 35 | free (an_id: INTEGER) 36 | -- Set `an_id' to be free. 37 | do 38 | id_list.force (False, an_id) 39 | ensure 40 | is_taken: not is_taken (an_id) 41 | end 42 | 43 | feature -- Status report 44 | 45 | is_taken (an_id: INTEGER): BOOLEAN 46 | -- Is `an_id' taken? 47 | do 48 | if an_id <= id_list.count then 49 | Result := id_list.item (an_id) 50 | else 51 | Result := False 52 | end 53 | end 54 | 55 | feature -- Search 56 | 57 | next_free_index: INTEGER 58 | -- Get the next free index. 59 | do 60 | -- Todo improve implementation 61 | Result := id_list.count + 1 62 | end 63 | 64 | feature {NONE} -- Implementation 65 | 66 | id_list: DS_ARRAYED_LIST [BOOLEAN] 67 | 68 | end 69 | -------------------------------------------------------------------------------- /library/traffic_line_cursor.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Cursor for TRAFFIC_LINE objects (to avoid moving internal cursors of the line)" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_LINE_CURSOR 8 | 9 | create 10 | make 11 | 12 | feature {NONE} -- Initialization 13 | 14 | make (a_line: TRAFFIC_LINE) 15 | -- Create for `a_line' and set direction to forward. 16 | require 17 | a_line_exists: a_line /= Void 18 | do 19 | create internal_cursor.make (a_line.one_direction) 20 | line := a_line 21 | ensure 22 | line_set: line = a_line 23 | internal_cursor_exists: internal_cursor /= Void 24 | end 25 | 26 | feature -- Access 27 | 28 | item_for_iteration: TRAFFIC_LINE_SEGMENT 29 | -- Item at internal cursor position of line 30 | require 31 | not_after: not after 32 | do 33 | Result := internal_cursor.item 34 | end 35 | 36 | line: TRAFFIC_LINE 37 | -- Line that the cursor traverses 38 | 39 | feature -- Cursor movement 40 | 41 | set_cursor_direction (forward: BOOLEAN) 42 | -- Use `True' for traversal from `terminal_1' to `terminal_2', `false' otherwise. 43 | do 44 | if forward then 45 | create internal_cursor.make (line.one_direction) 46 | internal_cursor.start 47 | else 48 | create internal_cursor.make (line.other_direction) 49 | internal_cursor.start 50 | end 51 | ensure 52 | internal_cursor_exists: internal_cursor /= Void 53 | end 54 | 55 | start 56 | -- Move internal cursor to first position. 57 | do 58 | internal_cursor.start 59 | end 60 | 61 | forth 62 | -- Move internal cursor to next position. 63 | require 64 | not_after: not after 65 | do 66 | internal_cursor.forth 67 | end 68 | 69 | feature -- Status report 70 | 71 | is_cursor_one_direction: BOOLEAN 72 | -- Is the cursor currently working on the direction from `terminal_1' to `terminal_2'? 73 | do 74 | Result := internal_cursor.container = line.one_direction 75 | end 76 | 77 | after: BOOLEAN 78 | -- Is there no valid position to right of internal cursor? 79 | do 80 | Result := internal_cursor.after 81 | end 82 | 83 | feature {NONE} -- Implementation 84 | 85 | internal_cursor: DS_LINKED_LIST_CURSOR [TRAFFIC_LINE_SEGMENT] 86 | -- Internal cursor used for traversal 87 | 88 | end 89 | -------------------------------------------------------------------------------- /library/traffic_polygon.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Objects that ..." 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_POLYGON 8 | 9 | create 10 | make 11 | 12 | feature 13 | make (a_point_array: like points; a_color: like color) 14 | -- Create a polygon from `a_point_array' and `a_color' 15 | require 16 | a_point_array_not_void: a_point_array /= Void 17 | local 18 | 19 | do 20 | set_color (a_color) 21 | set_points (a_point_array) 22 | create points_with_y_inverted.make (a_point_array.lower, a_point_array.upper) 23 | points_with_y_inverted.copy (a_point_array) 24 | invert_y_coordinates 25 | ensure 26 | points_set: points = a_point_array 27 | color_set: color = a_color 28 | end 29 | 30 | feature -- Access 31 | 32 | color: TRAFFIC_COLOR 33 | 34 | points: ARRAY [REAL_COORDINATE] 35 | -- The points of the polygon 36 | 37 | points_with_y_inverted: ARRAY [REAL_COORDINATE] 38 | -- The points of the polygon with y set to -y 39 | 40 | feature -- Commands 41 | 42 | set_points (new_points: like points) 43 | -- Replace the polygon's points with `new_points' 44 | require 45 | new_points_not_void: new_points /= Void 46 | do 47 | points:= new_points 48 | ensure 49 | new_points: points = new_points 50 | end 51 | 52 | set_color (new_color: like color) 53 | -- Replace the polygon's color with `new_color' 54 | require 55 | new_color_not_void: new_color /= Void 56 | do 57 | color:= new_color 58 | ensure 59 | new_color: color = new_color 60 | end 61 | 62 | feature {NONE} -- Implementation 63 | 64 | invert_y_coordinates 65 | -- sets the y coordinate of all `points_with_y_inverted' to -y. 66 | local 67 | i: INTEGER 68 | new: REAL_COORDINATE 69 | do 70 | from 71 | i:= 1 72 | until 73 | i > points_with_y_inverted.count 74 | loop 75 | create new.make (points_with_y_inverted[i].x, -points_with_y_inverted[i].y ) 76 | points_with_y_inverted.put (new, i) 77 | i := i+1 78 | end 79 | end 80 | 81 | 82 | 83 | invariant 84 | 85 | points_not_void: points /= Void 86 | 87 | inverted_points_not_void: points_with_y_inverted /= void 88 | 89 | end 90 | -------------------------------------------------------------------------------- /library/traffic_segment_state.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "State of line segment." 3 | date: "$Date: 2009-08-21 13:35:22 +0200 (Пт, 21 авг 2009) $" 4 | revision: "$Revision: 1098 $" 5 | 6 | class 7 | TRAFFIC_SEGMENT_STATE 8 | 9 | inherit 10 | 11 | ANY 12 | redefine 13 | out 14 | end 15 | 16 | create 17 | make 18 | 19 | feature {NONE} -- Inititalization 20 | 21 | make 22 | -- Set state to normal. 23 | do 24 | value := State_normal 25 | ensure 26 | value_valid: is_valid_state_value (value) 27 | end 28 | 29 | feature -- Access 30 | 31 | value: INTEGER 32 | -- Current state. 33 | 34 | feature -- Element change 35 | 36 | set_state (a_value: INTEGER) 37 | -- Set `value' to `a_value'. 38 | require 39 | is_valid_state_value (a_value) 40 | do 41 | value := a_value 42 | ensure 43 | value_set: value = a_value 44 | end 45 | 46 | feature -- Constants 47 | 48 | State_normal, State_collision: INTEGER = unique 49 | -- State constants 50 | 51 | feature -- Status report 52 | 53 | is_valid_state_value (a_state_value: INTEGER): BOOLEAN 54 | -- Is `a_state_value' a state constants? 55 | do 56 | Result := False 57 | 58 | inspect 59 | a_state_value 60 | when State_normal then 61 | Result := True 62 | when State_collision then 63 | Result := True 64 | end 65 | end 66 | 67 | feature -- Basic operation 68 | 69 | to_string (a_state_value: INTEGER): STRING 70 | -- String representation of state `a_state_value' 71 | require 72 | a_state_value_valid: is_valid_state_value (a_state_value) 73 | do 74 | inspect 75 | a_state_value 76 | when State_normal then 77 | Result := "normal" 78 | when State_collision then 79 | Result := "collision" 80 | else 81 | Result := "not defined" 82 | end 83 | end 84 | 85 | feature -- Basic operation 86 | 87 | out: STRING 88 | -- Textual representation 89 | do 90 | Result := "state: " + to_string (value) 91 | end 92 | 93 | invariant 94 | value_valid: is_valid_state_value (value) -- Valid state value. 95 | 96 | end 97 | -------------------------------------------------------------------------------- /library/traffic_simple_stop.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "A simple version of the class TRAFFIC_STOP" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_SIMPLE_STOP 8 | 9 | feature 10 | 11 | station: TRAFFIC_STATION 12 | -- Station which this stop represents 13 | 14 | right: TRAFFIC_SIMPLE_STOP 15 | -- Next stop on same line 16 | 17 | set_station(s: TRAFFIC_STATION) 18 | --Associate this stop with `s' 19 | require 20 | station_exists: s/= void 21 | do 22 | station := s 23 | ensure 24 | station_set: station = s 25 | end 26 | 27 | link(s: TRAFFIC_SIMPLE_STOP) 28 | -- make `s' the next stop on the line 29 | do 30 | right := s 31 | ensure 32 | right_set: right = s 33 | end 34 | 35 | 36 | end 37 | -------------------------------------------------------------------------------- /library/traffic_station_information.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Additional information on a station." 3 | date: "$Date: 2009-08-21 13:35:22 +0200 (Пт, 21 авг 2009) $" 4 | revision: "$Revision: 1098 $" 5 | 6 | class 7 | TRAFFIC_STATION_INFORMATION 8 | 9 | inherit 10 | ANY 11 | redefine 12 | out 13 | end 14 | 15 | create 16 | make 17 | 18 | feature {NONE} -- Initialization 19 | 20 | make 21 | -- Create empty information. 22 | do 23 | create pictures.make 24 | ensure 25 | pictures_exists: pictures /= Void 26 | end 27 | 28 | feature -- Access 29 | 30 | pictures: LINKED_LIST [STRING] 31 | -- Path to picture 32 | 33 | description: STRING 34 | -- Description 35 | 36 | feature -- Element change 37 | 38 | extend_picture (a_picture_path: STRING) 39 | -- Set picture path to `a_picture_path'. 40 | require 41 | a_picture_path_exists: a_picture_path /= Void 42 | do 43 | pictures.extend (a_picture_path) 44 | ensure 45 | picture_set: pictures.has (a_picture_path) 46 | end 47 | 48 | set_description (a_description: STRING) 49 | -- Set description to `a_desciption'. 50 | require 51 | a_description_exists: a_description /= Void 52 | do 53 | description := a_description 54 | ensure 55 | description_set: description = a_description 56 | end 57 | 58 | feature -- Removal 59 | 60 | remove_picture (a_picture_path: STRING) 61 | -- Remove picture path from pictures. 62 | require 63 | picture_in_pictures: pictures.has (a_picture_path) 64 | do 65 | pictures.prune (a_picture_path) 66 | ensure 67 | picture_removed: not pictures.has (a_picture_path) 68 | end 69 | 70 | remove_description 71 | -- Remove desription. 72 | do 73 | description := Void 74 | ensure 75 | description_removed: description = Void 76 | end 77 | 78 | feature -- Output 79 | 80 | out: STRING 81 | -- Textual representation. 82 | do 83 | Result := "" 84 | if pictures.count > 0 then 85 | from 86 | pictures.start 87 | Result := Result + "pictures: " 88 | until 89 | pictures.after 90 | loop 91 | Result := Result + pictures.item 92 | pictures.forth 93 | if not pictures.after then 94 | Result := Result + ", " 95 | end 96 | end 97 | end 98 | if description /= Void then 99 | if pictures.count > 0 then 100 | Result := Result + ", " 101 | end 102 | Result := Result + "description: " + description 103 | end 104 | end 105 | 106 | invariant 107 | pictures_exists: pictures /= Void 108 | 109 | end 110 | -------------------------------------------------------------------------------- /library/traffic_vision2.ecf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | .svn 31 | EIFGENs 32 | visualization/em 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /library/traffic_vision2_safe.ecf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | .svn 31 | EIFGENs 32 | visualization/em 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /library/type/traffic_type.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Describes types of TRAFFIC_ROADs and TRAFFIC_LINEs" 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision: 1133 $" 5 | 6 | deferred class 7 | TRAFFIC_TYPE 8 | 9 | inherit 10 | ANY 11 | redefine 12 | out, 13 | is_equal 14 | end 15 | 16 | feature -- Access 17 | 18 | name: STRING 19 | -- String representation 20 | 21 | speed: REAL_64 = 10.0 22 | -- Default speed 23 | 24 | feature -- Output 25 | 26 | out: STRING 27 | -- String representation of class 28 | do 29 | Result := name 30 | end 31 | 32 | feature -- Comparison 33 | 34 | is_equal (other: like Current): BOOLEAN 35 | -- Is `other' equal to `Current'? 36 | do 37 | Result := name.is_equal (other.name) 38 | end 39 | 40 | invariant 41 | name_not_empty: not name.is_empty 42 | 43 | end 44 | -------------------------------------------------------------------------------- /library/type/traffic_type_bus.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Bus type." 3 | date: "$Date: 2006-06-26 20:01:11$" 4 | revision: "$Revision: 737 $" 5 | 6 | class 7 | TRAFFIC_TYPE_BUS 8 | 9 | inherit 10 | TRAFFIC_TYPE_LINE 11 | 12 | create 13 | make 14 | 15 | feature -- Creation 16 | 17 | make 18 | -- Create new bus type. 19 | do 20 | name := "bus" 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /library/type/traffic_type_dispatcher_taxi.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Dispatcher taxi type." 3 | date: "$Date: 2006-06-26 20:01:11 $" 4 | revision: "$Revision: 602 $" 5 | 6 | class 7 | TRAFFIC_TYPE_DISPATCHER_TAXI 8 | 9 | inherit 10 | TRAFFIC_TYPE 11 | 12 | create 13 | make 14 | 15 | feature -- Creation 16 | 17 | make 18 | -- Create new dispatcher taxi type. 19 | do 20 | name := "dispatcher taxi" 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /library/type/traffic_type_event_taxi.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Event taxi type." 3 | date: "$Date: 2006-06-26 $" 4 | revision: "$Revision: 602 $" 5 | 6 | class 7 | TRAFFIC_TYPE_EVENT_TAXI 8 | 9 | inherit 10 | TRAFFIC_TYPE 11 | 12 | create 13 | make 14 | 15 | feature -- Creation 16 | 17 | make 18 | -- Create new event taxi type. 19 | do 20 | name := "event taxi" 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /library/type/traffic_type_lightrail.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Lightrail road type." 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_TYPE_LIGHTRAIL 8 | 9 | inherit 10 | TRAFFIC_TYPE_STREET 11 | redefine make end 12 | 13 | create 14 | make 15 | 16 | 17 | feature -- Creation 18 | 19 | make 20 | -- Create new street type. 21 | do 22 | name := "lightrail" 23 | end 24 | 25 | feature -- Basic 26 | 27 | 28 | 29 | 30 | end 31 | -------------------------------------------------------------------------------- /library/type/traffic_type_line.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Base class for line types." 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_TYPE_LINE 8 | 9 | inherit 10 | TRAFFIC_TYPE 11 | 12 | feature -- Basic 13 | 14 | is_allowed_type(a_moving: TRAFFIC_MOVING): BOOLEAN 15 | -- Is 'a_moving' allowed to go on a route? 16 | local 17 | line_vehicle: TRAFFIC_LINE_VEHICLE 18 | do 19 | line_vehicle?=a_moving 20 | if line_vehicle/=Void then 21 | Result:=true 22 | else 23 | Result:=false 24 | end 25 | end 26 | 27 | 28 | end 29 | -------------------------------------------------------------------------------- /library/type/traffic_type_rail.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Rail type." 3 | date: "$Date: 2006-07-25 14:34:57 +0200 (Вт, 25 июл 2006) $" 4 | revision: "$Revision: 737 $" 5 | 6 | class 7 | TRAFFIC_TYPE_RAIL 8 | 9 | inherit 10 | TRAFFIC_TYPE_LINE 11 | 12 | create 13 | make 14 | 15 | feature -- Creation 16 | 17 | make 18 | -- Create new rail type. 19 | do 20 | name := "rail" 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /library/type/traffic_type_railroad.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Railroad type." 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_TYPE_RAILROAD 8 | 9 | inherit 10 | 11 | TRAFFIC_TYPE_ROAD 12 | redefine 13 | is_allowed_type 14 | end 15 | 16 | create 17 | make 18 | 19 | feature -- Creation 20 | 21 | make 22 | -- Create new street type. 23 | do 24 | name := "railroad" 25 | end 26 | 27 | 28 | feature -- Basic 29 | 30 | is_allowed_type(a_moving: TRAFFIC_MOVING): BOOLEAN 31 | -- Is 'a_moving' allowed to go on a walk road? 32 | local 33 | line_vehicle: TRAFFIC_LINE_VEHICLE 34 | do 35 | line_vehicle?=a_moving 36 | if line_vehicle/=Void then 37 | Result:=true 38 | end 39 | end 40 | 41 | end 42 | -------------------------------------------------------------------------------- /library/type/traffic_type_road.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Base class for road's types" 3 | date: "$Date: 6/6/2006$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_TYPE_ROAD 8 | 9 | inherit 10 | 11 | TRAFFIC_TYPE 12 | 13 | feature -- Basic 14 | 15 | is_allowed_type(a_moving: TRAFFIC_MOVING): BOOLEAN 16 | -- Is 'a_moving' allowed to go on a route? 17 | local 18 | line_vehicle: TRAFFIC_VEHICLE 19 | do 20 | line_vehicle?=a_moving 21 | if line_vehicle/=Void then 22 | Result:=true 23 | else 24 | Result:=false 25 | end 26 | end 27 | 28 | is_allowed_walking: BOOLEAN 29 | -- Is it allowed to walk on 'a_road'? 30 | local 31 | street: TRAFFIC_TYPE_STREET 32 | do 33 | create street.make 34 | Result := street.name.is_equal (name) 35 | end 36 | 37 | end 38 | 39 | 40 | -------------------------------------------------------------------------------- /library/type/traffic_type_street.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Street type." 3 | date: "$Date: 2006-07-25 17:14:39 +0200 (Вт, 25 июл 2006) $" 4 | revision: "$Revision: 742 $" 5 | 6 | class 7 | TRAFFIC_TYPE_STREET 8 | 9 | inherit 10 | TRAFFIC_TYPE_ROAD 11 | 12 | create 13 | make 14 | 15 | feature -- Creation 16 | 17 | make 18 | -- Create new street type. 19 | do 20 | name := "street" 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /library/type/traffic_type_tram.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Tram type." 3 | date: "$Date: 2009-08-21 13:35:22 +0200 (Пт, 21 авг 2009) $" 4 | revision: "$Revision: 1098 $" 5 | 6 | class 7 | TRAFFIC_TYPE_TRAM 8 | 9 | inherit 10 | TRAFFIC_TYPE_LINE 11 | redefine is_allowed_type end 12 | 13 | create 14 | make 15 | 16 | feature -- Creation 17 | 18 | make 19 | -- Create new tram type. 20 | do 21 | name := "tram" 22 | end 23 | 24 | feature -- Basic 25 | 26 | is_allowed_type(a_moving: TRAFFIC_MOVING): BOOLEAN 27 | -- Is 'a_moving' allowed to go on a walk road? 28 | local 29 | tram: TRAFFIC_PASSENGER 30 | do 31 | tram?=a_moving 32 | if tram/=Void then 33 | Result:=true 34 | end 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /library/type/traffic_type_walking.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Walking type." 3 | date: "$Date: 2009-08-21 13:35:22 +0200 (Пт, 21 авг 2009) $" 4 | revision: "$Revision: 1098 $" 5 | 6 | class 7 | TRAFFIC_TYPE_WALKING 8 | 9 | inherit 10 | TRAFFIC_TYPE_LINE 11 | redefine 12 | is_allowed_type 13 | end 14 | 15 | create 16 | make 17 | 18 | feature -- Creation 19 | 20 | make 21 | -- Create new walking type. 22 | do 23 | name := "walking" 24 | end 25 | 26 | 27 | feature -- Basic 28 | 29 | is_allowed_type(a_moving: TRAFFIC_MOVING): BOOLEAN 30 | -- Is 'a_moving' allowed to go on a walk road? 31 | local 32 | passenger: TRAFFIC_PASSENGER 33 | do 34 | passenger?=a_moving 35 | if passenger/=Void then 36 | Result:=true 37 | end 38 | end 39 | 40 | end 41 | -------------------------------------------------------------------------------- /library/utility/gl_tools/gl_vector_4d.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | 4 | A 4-dimensional vector that can be used with OpenGL. 5 | Note: this is a simple implementation which doesn't allow any mathematics. 6 | 7 | ]" 8 | date: "$Date: 2005/09/05 11:08:11 $" 9 | revision: "$Revision: 1.1 $" 10 | 11 | class 12 | GL_VECTOR_4D [G] 13 | 14 | inherit 15 | GL_VECTOR_3D [G] 16 | redefine 17 | out, 18 | debug_output 19 | end 20 | 21 | create 22 | make_xyzt 23 | 24 | feature {NONE} -- Initialisation 25 | 26 | make_xyzt (a_x, a_y, a_z, a_t: G) 27 | -- Initialise `Current' with values `a_x' `a_y' `a_z' `a_t'. 28 | require 29 | a_x_not_void: a_x /= Void 30 | a_y_not_void: a_y /= Void 31 | a_z_not_void: a_z /= Void 32 | a_t_not_void: a_z /= Void 33 | do 34 | create array.make (0,3) 35 | set_xyzt (a_x, a_y, a_z, a_t) 36 | ensure 37 | x_set: x = a_x 38 | y_set: y = a_y 39 | z_set: z = a_z 40 | t_set: t = a_t 41 | end 42 | 43 | feature -- Access 44 | 45 | t: G 46 | -- Fourth element 47 | do 48 | Result := array @ (3) 49 | ensure 50 | result_exists: Result /= Void 51 | end 52 | 53 | feature -- Element change 54 | 55 | set_xyzt (a_x, a_y, a_z, a_t: G) 56 | -- Set the values to `a_x' `a_y' `a_z' `a_t'. 57 | require 58 | a_x_not_void: a_x /= Void 59 | a_y_not_void: a_y /= Void 60 | a_z_not_void: a_z /= Void 61 | a_t_not_void: a_z /= Void 62 | do 63 | array.put (a_x, 0) 64 | array.put (a_y, 1) 65 | array.put (a_z, 2) 66 | array.put (a_t, 3) 67 | ensure 68 | x_set: x = a_x 69 | y_set: y = a_y 70 | z_set: z = a_z 71 | t_set: t = a_t 72 | end 73 | 74 | feature -- Support 75 | 76 | out, debug_output: STRING 77 | -- Convert to string. 78 | do 79 | create Result.make_from_string (x.out+"/"+y.out+"/"+z.out) 80 | end 81 | 82 | end 83 | -------------------------------------------------------------------------------- /library/utility/traffic_error_codes.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Error codes that may occur in Traffic" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_ERROR_CODES 8 | 9 | feature -- Map loading 10 | 11 | Traffic_error_xml_file_does_not_exist: INTEGER = 101 12 | 13 | Traffic_error_directory_does_not_exist: INTEGER = 102 14 | 15 | Traffic_error_loading_dump_file: INTEGER = 103 16 | 17 | feature -- Miscellaneous 18 | 19 | Traffic_error_this_should_never_happen: INTEGER = 9003 20 | -- An error in a code section which shouldn't have been executed 21 | 22 | end 23 | -------------------------------------------------------------------------------- /library/utility/traffic_error_messages.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "[ 3 | 4 | Provide mapping of error constants from EM_ERROR_CODES to string messages. 5 | 6 | Placeholders are marked with '{#}' where '#' is the number of replacement. 7 | Zero is always the error code. 1, 2, etc. are indexes in the error data tuple. 8 | 9 | ]" 10 | date: "$Date$" 11 | revision: "$Revision$" 12 | 13 | class 14 | TRAFFIC_ERROR_MESSAGES 15 | 16 | inherit 17 | 18 | TRAFFIC_ERROR_CODES 19 | export {NONE} all end 20 | 21 | feature {NONE} -- Initialisation 22 | 23 | make_default_messages 24 | -- Initialise default error messages. 25 | do 26 | 27 | -- Map loading error messages 28 | Error_messages.force ("Directory {1} does not exist", Traffic_error_directory_does_not_exist) 29 | Error_messages.force ("Xml file {1} does not exist", Traffic_error_xml_file_does_not_exist) 30 | Error_messages.force ("Dump file loading {1} did not work", Traffic_error_loading_dump_file) 31 | 32 | -- Todo add other errors 33 | 34 | -- Miscellaneous error messages 35 | Error_messages.force ("A 'this should never happen' error has occured in section '{1}'. Please notify the developers", Traffic_error_this_should_never_happen) 36 | end 37 | 38 | feature -- Access 39 | 40 | Error_messages: DS_HASH_TABLE [STRING, INTEGER] 41 | -- Table which maps error codes to error messages. 42 | once 43 | create Result.make (100) 44 | make_default_messages 45 | ensure 46 | error_messages_not_void: Result /= Void 47 | end 48 | 49 | Default_error_message: STRING 50 | -- Message of errors whitout specialized message 51 | once 52 | Result := "Errorcode '{0}' - See traffic.tr_util.TRAFFIC_ERROR_CODES for more information" 53 | ensure 54 | default_error_message_not_void: Result /= Void 55 | end 56 | 57 | end 58 | -------------------------------------------------------------------------------- /library/utility/traffic_shared_error_handler.e: -------------------------------------------------------------------------------- 1 | note 2 | 3 | description: "[ 4 | 5 | Shared error message handler 6 | 7 | ]" 8 | date: "$Date$" 9 | revision: "$Revision$" 10 | 11 | class TRAFFIC_SHARED_ERROR_HANDLER 12 | 13 | feature -- Access 14 | 15 | Error_handler: TRAFFIC_ERROR_HANDLER 16 | -- EiffelMedia error handler 17 | once 18 | create Result.make 19 | ensure 20 | error_handler_not_void: Result /= Void 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /library/visualization/em/time/traffic_em_time.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "This object represent the time in the city model" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_EM_TIME 8 | 9 | inherit 10 | EM_TIME_SINGLETON 11 | undefine 12 | out 13 | end 14 | 15 | TRAFFIC_TIME 16 | 17 | EM_SHARED_SCENE 18 | undefine 19 | out 20 | end 21 | 22 | create 23 | make_with_speedup 24 | 25 | feature -- Basic operations 26 | 27 | start is 28 | -- Start to count the time at (0:0:0). 29 | do 30 | is_time_running := True 31 | running_scene.event_loop.update_event.subscribe (update_agent) 32 | real_ms_start := time.ticks 33 | simulated_ms_start := 0 34 | end 35 | 36 | pause is 37 | -- Pause the time count. 38 | do 39 | is_time_running := False 40 | running_scene.event_loop.update_event.unsubscribe (update_agent) 41 | simulated_ms_start := actual_time.seconds*1000 42 | end 43 | 44 | resume is 45 | -- Resume the paused time. 46 | do 47 | is_time_running := True 48 | running_scene.event_loop.update_event.subscribe (update_agent) 49 | real_ms_start := time.ticks 50 | end 51 | 52 | reset is 53 | -- Reset the time to (0:0:0). 54 | do 55 | actual_time.set_hour (0) 56 | actual_time.set_minute (0) 57 | actual_time.set_second (0) 58 | is_time_running := False 59 | real_ms_start := 0 60 | simulated_ms_start := 0 61 | running_scene.event_loop.update_event.unsubscribe (update_agent) 62 | end 63 | 64 | feature{NONE} -- Implementation 65 | 66 | update_time is 67 | -- Update the time count 68 | local 69 | real_ms: INTEGER 70 | sim_ms: INTEGER 71 | do 72 | if is_time_running then 73 | real_ms := time.ticks - real_ms_start 74 | sim_ms := speedup*real_ms + simulated_ms_start 75 | if sim_ms//1000 >= actual_time.seconds_in_day then 76 | real_ms_start := time.ticks 77 | sim_ms := (sim_ms//1000)\\actual_time.seconds_in_day 78 | simulated_ms_start := sim_ms 79 | actual_day := actual_day + 1 80 | actual_time.make_by_seconds (sim_ms) 81 | else 82 | actual_time.make_by_seconds (sim_ms//1000) 83 | actual_time.set_fractionals ((sim_ms\\1000)/1000) 84 | end 85 | call_tours 86 | call_procedure 87 | end 88 | end 89 | 90 | end 91 | -------------------------------------------------------------------------------- /library/visualization/em/time/traffic_shared_time.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Singleton that simulates time of the day" 3 | date: "$Date$" 4 | 5 | class 6 | TRAFFIC_SHARED_TIME 7 | 8 | feature -- Access 9 | 10 | time: TRAFFIC_TIME is 11 | -- Time singleton that simulates a day 12 | once 13 | create {TRAFFIC_EM_TIME} Result.make_with_speedup (2) 14 | ensure 15 | Result_exists: Result /= Void 16 | end 17 | 18 | end 19 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_2d/traffic_2d_scene.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TRAFFIC_2D_SCENE 9 | 10 | inherit 11 | 12 | TRAFFIC_EM_SCENE 13 | redefine 14 | map_widget 15 | end 16 | 17 | feature -- Initialization 18 | 19 | build_map_widget is 20 | -- Set up map widget. 21 | do 22 | create drawing_panel.make_from_dimension (width, height - 30) 23 | create map_widget.make_with_size (width, height - 30) 24 | drawing_panel.set_position (0, 30) 25 | -- map_widget.mouse_wheel_up_event.subscribe (agent map_widget.zoom_in) 26 | -- map_widget.mouse_wheel_down_event.subscribe (agent map_widget.zoom_out) 27 | drawing_panel.container.force_last (map_widget) 28 | drawing_panel.set_background_color (create {EM_COLOR}.make_white) 29 | add_component (drawing_panel) 30 | end 31 | 32 | set_agents is 33 | -- 34 | do 35 | 36 | end 37 | 38 | feature -- Access 39 | 40 | map_widget: TRAFFIC_2D_MAP_WIDGET 41 | 42 | drawing_panel: EM_DRAWABLE_PANEL 43 | 44 | end 45 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_2d/traffic_2d_view.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | deferred class 8 | TRAFFIC_2D_VIEW [G] 9 | 10 | inherit 11 | 12 | TRAFFIC_VIEW [G] 13 | 14 | EM_DRAWABLE 15 | 16 | feature -- Status report 17 | 18 | is_highlighted: BOOLEAN 19 | -- Is the place view highlighted? 20 | 21 | is_shown: BOOLEAN 22 | -- Is the place view shown? 23 | do 24 | Result := is_visible 25 | end 26 | 27 | feature -- Element change 28 | 29 | show is 30 | -- Show the renderable. 31 | do 32 | set_visible (True) 33 | end 34 | 35 | hide is 36 | -- Hide the renderable. 37 | do 38 | set_visible (False) 39 | end 40 | 41 | end 42 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_2d/traffic_2d_view_container.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TRAFFIC_2D_VIEW_CONTAINER [G] 9 | 10 | inherit 11 | 12 | TRAFFIC_VIEW_CONTAINER [G, TRAFFIC_2D_VIEW [G]] 13 | undefine 14 | is_equal, 15 | copy 16 | end 17 | 18 | EM_DRAWABLE_CONTAINER [TRAFFIC_2D_VIEW [G]] 19 | rename 20 | extend as put_last, 21 | extend_with_list as extend 22 | end 23 | 24 | create 25 | make 26 | 27 | end 28 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_abstract_vector1_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Array for 1-dimensional vectors" 3 | author: "" 4 | date: "$Date: 2006/08/21 15:39:17 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | deferred class 8 | EM_ABSTRACT_VECTOR1_ARRAY[N -> NUMERIC, V -> EM_ABSTRACT_VECTOR1[N]] 9 | 10 | inherit 11 | EM_ABSTRACT_VECTOR_ARRAY[N, V] 12 | 13 | feature -- Element change 14 | 15 | put (v: V; i: INTEGER) is 16 | -- Replace `i'-th entry, if in index interval, by `v'. 17 | do 18 | area.put (v.x, dimension*i) 19 | end 20 | 21 | feature {NONE} -- Implementation 22 | dimension: INTEGER is 1 23 | 24 | invariant 25 | invariant_clause: True -- Your invariant here 26 | 27 | end 28 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_abstract_vector2_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Array for 2-dimensional vectors" 3 | author: "" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | deferred class 8 | EM_ABSTRACT_VECTOR2_ARRAY[N -> NUMERIC, V -> EM_ABSTRACT_VECTOR2[N]] 9 | 10 | inherit 11 | EM_ABSTRACT_VECTOR_ARRAY[N, V] 12 | 13 | convert 14 | to_c_pointer: {POINTER} 15 | 16 | feature -- Element change 17 | 18 | put (v: V; i: INTEGER) is 19 | -- Replace `i'-th entry, if in index interval, by `v'. 20 | do 21 | area.put (v.x, dimension*i ) 22 | area.put (v.y, dimension*i + 1) 23 | end 24 | 25 | feature {NONE} -- Implementation 26 | dimension: INTEGER is 2 27 | 28 | invariant 29 | invariant_clause: True -- Your invariant here 30 | 31 | end 32 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_abstract_vector3_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Array for 3-dimensional vectors" 3 | author: "" 4 | date: "$Date: 2006/10/17 22:27:35 $" 5 | revision: "$Revision: 1.3 $" 6 | 7 | deferred class 8 | EM_ABSTRACT_VECTOR3_ARRAY[N -> NUMERIC, V -> EM_ABSTRACT_VECTOR3[N]] 9 | 10 | inherit 11 | EM_ABSTRACT_VECTOR_ARRAY[N, V] 12 | 13 | convert 14 | to_c_pointer: {POINTER} 15 | 16 | feature -- Element change 17 | 18 | put (v: V; i: INTEGER) is 19 | -- Replace `i'-th entry, if in index interval, by `v'. 20 | do 21 | area.put (v.x, dimension*i ) 22 | area.put (v.y, dimension*i + 1) 23 | area.put (v.z, dimension*i + 2) 24 | end 25 | 26 | feature {NONE} -- Implementation 27 | dimension: INTEGER is 3 28 | 29 | invariant 30 | invariant_clause: True -- Your invariant here 31 | 32 | end 33 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_abstract_vector4_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Array for 4-dimensional vectors" 3 | author: "" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.3 $" 6 | 7 | deferred class 8 | EM_ABSTRACT_VECTOR4_ARRAY[N -> NUMERIC, V -> EM_ABSTRACT_VECTOR4[N]] 9 | 10 | inherit 11 | EM_ABSTRACT_VECTOR_ARRAY[N, V] 12 | 13 | convert 14 | to_c_pointer: {POINTER} 15 | feature -- Element change 16 | 17 | put (v: V; i: INTEGER) is 18 | -- Replace `i'-th entry, if in index interval, by `v'. 19 | do 20 | area.put (v.x, dimension*i ) 21 | area.put (v.y, dimension*i + 1) 22 | area.put (v.y, dimension*i + 2) 23 | area.put (v.y, dimension*i + 3) 24 | end 25 | 26 | feature {NONE} -- Implementation 27 | dimension: INTEGER is 4 28 | 29 | invariant 30 | invariant_clause: True -- Your invariant here 31 | 32 | end 33 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_matrix44.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A 4x4 Matrix with basic operations" 3 | date: "$Date: 2006/08/18 09:47:33 $" 4 | revision: "$Revision: 1.3 $" 5 | 6 | expanded class 7 | EM_MATRIX44 8 | 9 | inherit 10 | EM_MATRIX44_REF 11 | rename 12 | make_empty as set_empty, 13 | make_from_tuple as set_from_tuple, 14 | make_from_translation as set_from_translation, 15 | make as set, 16 | make_from_scalar as set_from_scalar, 17 | make_from_rotation as set_from_rotation, 18 | make_unit as set_unit 19 | end 20 | 21 | create 22 | default_create, 23 | make_from_reference, 24 | make_from_quaternion 25 | convert 26 | make_from_reference({EM_MATRIX44_REF}), 27 | make_from_quaternion ({EM_QUATERNION}), 28 | to_pointer: {POINTER} 29 | 30 | end 31 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_plane.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "[ 3 | A plane describes by a plane equation 4 | ]" 5 | date: "$Date: Oct 15, 2006 4:36:44 PM$" 6 | revision: "$Revision: 1.0$" 7 | 8 | expanded class EM_PLANE 9 | 10 | inherit 11 | EM_PLANE_REF 12 | rename 13 | make as set, 14 | make_from_normal as set_from_normal, 15 | make_from_points as set_from_points 16 | export 17 | {ANY} set, set_from_normal, set_from_points, default_create 18 | end 19 | 20 | create 21 | default_create, 22 | make_from_reference, 23 | make_from_tuple, 24 | make_from_tuplei, 25 | make_from_tuplef, 26 | make_from_normal_tuple, 27 | make_from_normal_tuplei, 28 | make_from_normal_tuplef, 29 | make_from_point_tuple, 30 | make_from_point_tuplei, 31 | make_from_point_tuplef 32 | 33 | convert 34 | make_from_reference ({EM_PLANE_REF}), 35 | make_from_tuple ({TUPLE[DOUBLE, DOUBLE, DOUBLE, DOUBLE]}), 36 | make_from_tuplei ({TUPLE[INTEGER, INTEGER, INTEGER, INTEGER]}), 37 | make_from_tuplef ({TUPLE[REAL, REAL, REAL, REAL]}), 38 | make_from_normal_tuple ({TUPLE[EM_VECTOR3D,EM_VECTOR3D]}), 39 | make_from_normal_tuplei ({TUPLE[EM_VECTOR3I,EM_VECTOR3I]}), 40 | make_from_normal_tuplef ({TUPLE[EM_VECTOR3F,EM_VECTOR3F]}), 41 | make_from_point_tuple ({TUPLE[EM_VECTOR3D,EM_VECTOR3D,EM_VECTOR3D]}), 42 | make_from_point_tuplei ({TUPLE[EM_VECTOR3I,EM_VECTOR3I,EM_VECTOR3I]}), 43 | make_from_point_tuplef ({TUPLE[EM_VECTOR3F,EM_VECTOR3F,EM_VECTOR3F]}) 44 | 45 | end -- class EM_PLANE 46 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_quaternion.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A Quaternion is a replacement for retation-matrices. Its very fast and easy to interpolate, ... and can be transformed into a rotation matrix and vice versa " 3 | date: "$Date: 2006/10/17 22:27:36 $" 4 | revision: "$Revision: 1.5 $" 5 | 6 | expanded class 7 | EM_QUATERNION 8 | 9 | inherit 10 | EM_QUATERNION_REF 11 | rename 12 | make as set, 13 | make_from_rotation as set_from_rotation, 14 | make_from_matrix44 as set_from_matrix44, 15 | make_from_arc as set_from_arc 16 | end 17 | 18 | create 19 | default_create, 20 | make_from_reference, 21 | make_from_tuple, 22 | make_from_vector_tuple, 23 | make_from_vector_ref_tuple, 24 | set_from_matrix44 25 | 26 | convert 27 | make_from_reference ({EM_QUATERNION_REF}), 28 | make_from_tuple ({TUPLE[DOUBLE, DOUBLE, DOUBLE, DOUBLE]}), 29 | make_from_vector_ref_tuple ({TUPLE[EM_VECTOR3D_REF,DOUBLE]}), 30 | make_from_vector_tuple ({TUPLE[EM_VECTOR3D,DOUBLE]}), 31 | set_from_matrix44 ({EM_MATRIX44}) 32 | 33 | end 34 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector1d.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 1D-Vector. " 3 | 4 | date: "$Date: 2006/08/28 16:26:43 $" 5 | revision: "$Revision: 1.4 $" 6 | 7 | expanded class 8 | EM_VECTOR1D 9 | 10 | inherit 11 | EM_VECTOR1D_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuplei, 20 | make_from_tuplef, 21 | make_from_tuple, 22 | make_filled 23 | 24 | convert 25 | make_from_reference ({EM_VECTOR1D_REF}), 26 | make_from_tuplei ({TUPLE[INTEGER]}), 27 | make_from_tuplef ({TUPLE[REAL]}), 28 | make_from_tuple ({TUPLE[DOUBLE]}), 29 | 30 | to_vector1i: {EM_VECTOR1I}, 31 | to_vector2i: {EM_VECTOR2I}, 32 | to_vector3i: {EM_VECTOR3I}, 33 | to_vector4i: {EM_VECTOR4I}, 34 | 35 | to_vector2d: {EM_VECTOR2D}, 36 | to_vector3d: {EM_VECTOR3D}, 37 | to_vector4d: {EM_VECTOR4D}, 38 | 39 | to_vector1f: {EM_VECTOR1F}, 40 | to_vector2f: {EM_VECTOR2F}, 41 | to_vector3f: {EM_VECTOR3F}, 42 | to_vector4f: {EM_VECTOR4F}, 43 | 44 | to_tuple: {TUPLE[DOUBLE]}, 45 | to_pointer: {POINTER} 46 | 47 | end 48 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector1d_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 1D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | class EM_VECTOR1D_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR1_ARRAY[DOUBLE, EM_VECTOR1D] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR1D assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0) ] 24 | end 25 | 26 | end -- class EM_VECTOR_1D_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector1f.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 1D-Vector. " 3 | 4 | date: "$Date: 2006/08/28 16:26:43 $" 5 | revision: "$Revision: 1.4 $" 6 | 7 | expanded class 8 | EM_VECTOR1F 9 | 10 | inherit 11 | EM_VECTOR1F_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuplei, 20 | make_from_tuple, 21 | make_from_tupled, 22 | make_filled, 23 | make_filled_d 24 | 25 | convert 26 | make_from_reference ({EM_VECTOR1F_REF}), 27 | make_from_tuplei ({TUPLE[INTEGER]}), 28 | make_from_tuple ({TUPLE[REAL]}), 29 | make_from_tupled ({TUPLE[DOUBLE]}), 30 | 31 | to_vector1i: {EM_VECTOR1I}, 32 | to_vector2i: {EM_VECTOR2I}, 33 | to_vector3i: {EM_VECTOR3I}, 34 | to_vector4i: {EM_VECTOR4I}, 35 | 36 | to_vector1d: {EM_VECTOR1D}, 37 | to_vector2d: {EM_VECTOR2D}, 38 | to_vector3d: {EM_VECTOR3D}, 39 | to_vector4d: {EM_VECTOR4D}, 40 | 41 | to_vector2f: {EM_VECTOR2F}, 42 | to_vector3f: {EM_VECTOR3F}, 43 | to_vector4f: {EM_VECTOR4F}, 44 | 45 | to_tuple: {TUPLE[REAL]}, 46 | to_pointer: {POINTER} 47 | 48 | end 49 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector1f_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 1D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.3 $" 6 | 7 | class EM_VECTOR1f_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR1_ARRAY[REAL, EM_VECTOR1F] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR1F assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0) ] 24 | end 25 | 26 | end -- class EM_VECTOR_1F_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector1i.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 1D-Vector. " 3 | 4 | date: "$Date: 2006/08/28 16:26:43 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | expanded class 8 | EM_VECTOR1I 9 | 10 | inherit 11 | EM_VECTOR1I_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuple, 20 | make_from_tuplef, 21 | make_from_tupled, 22 | make_filled, 23 | make_filled_d 24 | 25 | convert 26 | make_from_reference ({EM_VECTOR1I_REF}), 27 | make_from_tuple ({TUPLE[INTEGER]}), 28 | make_from_tuplef ({TUPLE[REAL]}), 29 | make_from_tupled ({TUPLE[DOUBLE]}), 30 | 31 | to_vector2i: {EM_VECTOR2I}, 32 | to_vector3i: {EM_VECTOR3I}, 33 | to_vector4i: {EM_VECTOR4I}, 34 | 35 | to_vector1d: {EM_VECTOR1D}, 36 | to_vector2d: {EM_VECTOR2D}, 37 | to_vector3d: {EM_VECTOR3D}, 38 | to_vector4d: {EM_VECTOR4D}, 39 | 40 | to_vector1f: {EM_VECTOR1F}, 41 | to_vector2f: {EM_VECTOR2F}, 42 | to_vector3f: {EM_VECTOR3F}, 43 | to_vector4f: {EM_VECTOR4F}, 44 | 45 | to_tuple: {TUPLE[INTEGER]}, 46 | to_pointer: {POINTER} 47 | 48 | end 49 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector1i_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 1D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | class EM_VECTOR1I_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR1_ARRAY[INTEGER, EM_VECTOR1I] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR1I assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0) ] 24 | end 25 | 26 | end -- class EM_VECTOR_1I_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector2d.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 2D-Vector. " 3 | 4 | date: "$Date: 2006/08/28 16:26:43 $" 5 | revision: "$Revision: 1.7 $" 6 | 7 | expanded class 8 | EM_VECTOR2D 9 | 10 | inherit 11 | EM_VECTOR2D_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuple, 20 | make_from_tuplef, 21 | make_from_tuplei, 22 | make_filled 23 | 24 | convert 25 | make_from_reference ({EM_VECTOR2D_REF}), 26 | make_from_tuplei ({TUPLE[INTEGER, INTEGER]}), 27 | make_from_tuplef ({TUPLE[REAL, REAL]}), 28 | make_from_tuple ({TUPLE[DOUBLE, DOUBLE]}), 29 | 30 | to_vector1i: {EM_VECTOR1I}, 31 | to_vector2i: {EM_VECTOR2I}, 32 | to_vector3i: {EM_VECTOR3I}, 33 | to_vector4i: {EM_VECTOR4I}, 34 | 35 | to_vector1d: {EM_VECTOR1D}, 36 | to_vector3d: {EM_VECTOR3D}, 37 | to_vector4d: {EM_VECTOR4D}, 38 | 39 | to_vector1f: {EM_VECTOR1F}, 40 | to_vector2f: {EM_VECTOR2F}, 41 | to_vector3f: {EM_VECTOR3F}, 42 | to_vector4f: {EM_VECTOR4F}, 43 | 44 | to_tuple: {TUPLE[DOUBLE, DOUBLE]}, 45 | to_pointer: {POINTER} 46 | 47 | end 48 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector2d_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 2D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.4 $" 6 | 7 | class EM_VECTOR2D_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR2_ARRAY[DOUBLE, EM_VECTOR2D] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR2D assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1) ] 24 | end 25 | 26 | end -- class EM_VECTOR_2D_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector2f.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 2D-Vector. " 3 | 4 | date: "$Date: 2006/08/28 16:26:43 $" 5 | revision: "$Revision: 1.7 $" 6 | 7 | expanded class 8 | EM_VECTOR2F 9 | 10 | inherit 11 | EM_VECTOR2F_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuplei, 20 | make_from_tuple, 21 | make_from_tupled, 22 | make_filled, 23 | make_filled_d 24 | 25 | convert 26 | make_from_reference ({EM_VECTOR2F_REF}), 27 | make_from_tuplei ({TUPLE[INTEGER, INTEGER]}), 28 | make_from_tuple ({TUPLE[REAL, REAL]}), 29 | make_from_tupled ({TUPLE[DOUBLE, DOUBLE]}), 30 | 31 | to_vector1i: {EM_VECTOR1I}, 32 | to_vector2i: {EM_VECTOR2I}, 33 | to_vector3i: {EM_VECTOR3I}, 34 | to_vector4i: {EM_VECTOR4I}, 35 | 36 | to_vector1d: {EM_VECTOR1D}, 37 | to_vector2d: {EM_VECTOR2D}, 38 | to_vector3d: {EM_VECTOR3D}, 39 | to_vector4d: {EM_VECTOR4D}, 40 | 41 | to_vector1f: {EM_VECTOR1F}, 42 | to_vector3f: {EM_VECTOR3F}, 43 | to_vector4f: {EM_VECTOR4F}, 44 | 45 | to_tuple: {TUPLE[REAL, REAL]}, 46 | to_pointer: {POINTER} 47 | 48 | end 49 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector2f_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 2D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.4 $" 6 | 7 | class EM_VECTOR2F_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR2_ARRAY[REAL, EM_VECTOR2F] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR2F assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1) ] 24 | end 25 | 26 | end -- class EM_VECTOR_2F_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector2i.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 2D-Vector. " 3 | 4 | date: "$Date: 2006/08/28 16:26:43 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | expanded class 8 | EM_VECTOR2I 9 | 10 | inherit 11 | EM_VECTOR2I_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuple, 20 | make_from_tuplef, 21 | make_from_tupled, 22 | make_filled, 23 | make_filled_d 24 | 25 | convert 26 | make_from_reference ({EM_VECTOR2I_REF}), 27 | make_from_tuple ({TUPLE[INTEGER, INTEGER]}), 28 | make_from_tuplef ({TUPLE[REAL, REAL]}), 29 | make_from_tupled ({TUPLE[DOUBLE, DOUBLE]}), 30 | 31 | to_vector1i: {EM_VECTOR1I}, 32 | to_vector3i: {EM_VECTOR3I}, 33 | to_vector4i: {EM_VECTOR4I}, 34 | 35 | to_vector1d: {EM_VECTOR1D}, 36 | to_vector2d: {EM_VECTOR2D}, 37 | to_vector3d: {EM_VECTOR3D}, 38 | to_vector4d: {EM_VECTOR4D}, 39 | 40 | to_vector1f: {EM_VECTOR1F}, 41 | to_vector2f: {EM_VECTOR2F}, 42 | to_vector3f: {EM_VECTOR3F}, 43 | to_vector4f: {EM_VECTOR4F}, 44 | 45 | to_tuple: {TUPLE[INTEGER, INTEGER]}, 46 | to_pointer: {POINTER} 47 | 48 | end 49 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector2i_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 2D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | class EM_VECTOR2I_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR2_ARRAY[INTEGER, EM_VECTOR2I] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR2I assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1) ] 24 | end 25 | 26 | end -- class EM_VECTOR_2I_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector3d.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 3D-Vector. " 3 | 4 | date: "$Date: 2006/08/24 11:20:29 $" 5 | revision: "$Revision: 1.6 $" 6 | 7 | expanded class 8 | EM_VECTOR3D 9 | 10 | inherit 11 | EM_VECTOR3D_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuple, 20 | make_from_tuplei, 21 | make_from_tuplef 22 | 23 | convert 24 | make_from_reference ({EM_VECTOR3D_REF}), 25 | make_from_tuplei ({TUPLE[INTEGER, INTEGER, INTEGER]}), 26 | make_from_tuplef ({TUPLE[REAL, REAL, REAL]}), 27 | make_from_tuple ({TUPLE[DOUBLE, DOUBLE, DOUBLE]}), 28 | 29 | to_vector1i: {EM_VECTOR1I}, 30 | to_vector2i: {EM_VECTOR2I}, 31 | to_vector3i: {EM_VECTOR3I}, 32 | to_vector4i: {EM_VECTOR4I}, 33 | 34 | to_vector1f: {EM_VECTOR1F}, 35 | to_vector2f: {EM_VECTOR2F}, 36 | to_vector3f: {EM_VECTOR3F}, 37 | to_vector4f: {EM_VECTOR4F}, 38 | 39 | to_vector1d: {EM_VECTOR1D}, 40 | to_vector2d: {EM_VECTOR2D}, 41 | to_vector4d: {EM_VECTOR4D}, 42 | 43 | to_tuple: {TUPLE[DOUBLE, DOUBLE, DOUBLE]}, 44 | to_pointer: {POINTER} 45 | 46 | end 47 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector3d_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 3D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.5 $" 6 | 7 | class EM_VECTOR3D_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR3_ARRAY[DOUBLE, EM_VECTOR3D] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR3D assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1), area.item(i*dimension + 2) ] 24 | end 25 | 26 | end -- class EM_VECTOR_3D_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector3f.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 3D-Vector. " 3 | 4 | date: "$Date: 2006/08/24 11:20:29 $" 5 | revision: "$Revision: 1.6 $" 6 | 7 | expanded class 8 | EM_VECTOR3F 9 | 10 | inherit 11 | EM_VECTOR3F_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuplei, 20 | make_from_tuple, 21 | make_from_tupled 22 | 23 | convert 24 | make_from_reference ({EM_VECTOR3F_REF}), 25 | make_from_tuplei ({TUPLE[INTEGER, INTEGER, INTEGER]}), 26 | make_from_tuple ({TUPLE[REAL, REAL, REAL]}), 27 | make_from_tupled ({TUPLE[DOUBLE, DOUBLE, DOUBLE]}), 28 | 29 | to_vector1i: {EM_VECTOR1I}, 30 | to_vector2i: {EM_VECTOR2I}, 31 | to_vector3i: {EM_VECTOR3I}, 32 | to_vector4i: {EM_VECTOR4I}, 33 | 34 | to_vector1f: {EM_VECTOR1F}, 35 | to_vector2f: {EM_VECTOR2F}, 36 | to_vector4f: {EM_VECTOR4F}, 37 | 38 | to_vector1d: {EM_VECTOR1D}, 39 | to_vector2d: {EM_VECTOR2D}, 40 | to_vector3d: {EM_VECTOR3D}, 41 | to_vector4d: {EM_VECTOR4D}, 42 | 43 | to_tuple: {TUPLE[REAL, REAL, REAL]}, 44 | to_pointer: {POINTER} 45 | 46 | end 47 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector3f_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 3D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.5 $" 6 | 7 | class EM_VECTOR3F_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR3_ARRAY[REAL, EM_VECTOR3F] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR3F assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1), area.item(i*dimension + 2) ] 24 | end 25 | 26 | end -- class EM_VECTOR_3D_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector3i.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 3D-Vector. " 3 | 4 | date: "$Date: 2006/08/24 11:20:29 $" 5 | revision: "$Revision: 1.1 $" 6 | 7 | expanded class 8 | EM_VECTOR3I 9 | 10 | inherit 11 | EM_VECTOR3I_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuple, 20 | make_from_tuplef, 21 | make_from_tupled 22 | 23 | convert 24 | make_from_reference ({EM_VECTOR3I_REF}), 25 | make_from_tuple ({TUPLE[INTEGER, INTEGER, INTEGER]}), 26 | make_from_tuplef ({TUPLE[REAL, REAL, REAL]}), 27 | make_from_tupled ({TUPLE[DOUBLE, DOUBLE, DOUBLE]}), 28 | 29 | to_vector1i: {EM_VECTOR1I}, 30 | to_vector2i: {EM_VECTOR2I}, 31 | to_vector4i: {EM_VECTOR4I}, 32 | 33 | to_vector1f: {EM_VECTOR1F}, 34 | to_vector2f: {EM_VECTOR2F}, 35 | to_vector3f: {EM_VECTOR3F}, 36 | to_vector4f: {EM_VECTOR4F}, 37 | 38 | to_vector1d: {EM_VECTOR1D}, 39 | to_vector2d: {EM_VECTOR2D}, 40 | to_vector3d: {EM_VECTOR3D}, 41 | to_vector4d: {EM_VECTOR4D}, 42 | 43 | to_tuple: {TUPLE[INTEGER, INTEGER, INTEGER]}, 44 | to_pointer: {POINTER} 45 | 46 | end 47 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector3i_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 3D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | class EM_VECTOR3I_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR3_ARRAY[INTEGER, EM_VECTOR3I] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR3I assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1), area.item(i*dimension + 2) ] 24 | end 25 | 26 | end -- class EM_VECTOR_3I_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector4d.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 4D-Vector. " 3 | 4 | date: "$Date: 2006/08/24 11:20:29 $" 5 | revision: "$Revision: 1.6 $" 6 | 7 | expanded class 8 | EM_VECTOR4D 9 | 10 | inherit 11 | EM_VECTOR4D_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuple, 20 | make_from_tuplef, 21 | make_from_tuplei 22 | 23 | convert 24 | make_from_reference ({EM_VECTOR4D_REF}), 25 | 26 | make_from_tuplei ({TUPLE[INTEGER, INTEGER, INTEGER, INTEGER]}), 27 | make_from_tuplef ({TUPLE[REAL, REAL, REAL, REAL]}), 28 | make_from_tuple ({TUPLE[DOUBLE, DOUBLE, DOUBLE, DOUBLE]}), 29 | 30 | to_vector1i: {EM_VECTOR1I}, 31 | to_vector2i: {EM_VECTOR2I}, 32 | to_vector3i: {EM_VECTOR3I}, 33 | to_vector4i: {EM_VECTOR4I}, 34 | 35 | to_vector1f: {EM_VECTOR1F}, 36 | to_vector2f: {EM_VECTOR2F}, 37 | to_vector3f: {EM_VECTOR3F}, 38 | to_vector4f: {EM_VECTOR4F}, 39 | 40 | to_vector1d: {EM_VECTOR1D}, 41 | to_vector2d: {EM_VECTOR2D}, 42 | to_vector3d: {EM_VECTOR3D}, 43 | 44 | to_tuple: {TUPLE[DOUBLE, DOUBLE, DOUBLE, DOUBLE]}, 45 | to_pointer: {POINTER} 46 | 47 | end 48 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector4d_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 4D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.5 $" 6 | 7 | class EM_VECTOR4D_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR4_ARRAY[DOUBLE, EM_VECTOR4D] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR4D assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1), area.item(i*dimension + 2), area.item(i*dimension + 3) ] 24 | end 25 | 26 | end -- class EM_VECTOR_4D_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector4f.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 4D-Vector. " 3 | 4 | date: "$Date: 2006/08/24 11:20:29 $" 5 | revision: "$Revision: 1.6 $" 6 | 7 | expanded class 8 | EM_VECTOR4F 9 | 10 | inherit 11 | EM_VECTOR4F_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuplei, 20 | make_from_tuple, 21 | make_from_tupled 22 | 23 | convert 24 | make_from_reference ({EM_VECTOR4F_REF}), 25 | 26 | make_from_tuplei ({TUPLE[INTEGER, INTEGER, INTEGER, INTEGER]}), 27 | make_from_tuple ({TUPLE[REAL, REAL, REAL, REAL]}), 28 | make_from_tupled ({TUPLE[DOUBLE, DOUBLE, DOUBLE, DOUBLE]}), 29 | 30 | to_vector1i: {EM_VECTOR1I}, 31 | to_vector2i: {EM_VECTOR2I}, 32 | to_vector3i: {EM_VECTOR3I}, 33 | to_vector4i: {EM_VECTOR4I}, 34 | 35 | to_vector1f: {EM_VECTOR1F}, 36 | to_vector2f: {EM_VECTOR2F}, 37 | to_vector3f: {EM_VECTOR3F}, 38 | 39 | to_vector1d: {EM_VECTOR1D}, 40 | to_vector2d: {EM_VECTOR2D}, 41 | to_vector3d: {EM_VECTOR3D}, 42 | to_vector4d: {EM_VECTOR4D}, 43 | 44 | to_tuple: {TUPLE[REAL, REAL, REAL, REAL]}, 45 | to_pointer: {POINTER} 46 | 47 | end 48 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector4f_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 4D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.5 $" 6 | 7 | class EM_VECTOR4F_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR4_ARRAY[REAL, EM_VECTOR4F] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR4F assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1), area.item(i*dimension + 2), area.item(i*dimension + 3) ] 24 | end 25 | 26 | end -- class EM_VECTOR_4F_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector4i.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: " A simple 4D-Vector. " 3 | 4 | date: "$Date: 2006/08/24 11:20:29 $" 5 | revision: "$Revision: 1.1 $" 6 | 7 | expanded class 8 | EM_VECTOR4I 9 | 10 | inherit 11 | EM_VECTOR4I_REF 12 | rename 13 | make as set 14 | end 15 | 16 | create 17 | make_from_reference, 18 | default_create, 19 | make_from_tuple, 20 | make_from_tuplef, 21 | make_from_tupled 22 | 23 | convert 24 | make_from_reference ({EM_VECTOR4I_REF}), 25 | 26 | make_from_tuple ({TUPLE[INTEGER, INTEGER, INTEGER, INTEGER]}), 27 | make_from_tuplef ({TUPLE[REAL, REAL, REAL, REAL]}), 28 | make_from_tupled ({TUPLE[DOUBLE, DOUBLE, DOUBLE, DOUBLE]}), 29 | 30 | to_vector1i: {EM_VECTOR1I}, 31 | to_vector2i: {EM_VECTOR2I}, 32 | to_vector3i: {EM_VECTOR3I}, 33 | 34 | to_vector1f: {EM_VECTOR1F}, 35 | to_vector2f: {EM_VECTOR2F}, 36 | to_vector3f: {EM_VECTOR3F}, 37 | to_vector4f: {EM_VECTOR4F}, 38 | 39 | to_vector1d: {EM_VECTOR1D}, 40 | to_vector2d: {EM_VECTOR2D}, 41 | to_vector3d: {EM_VECTOR3D}, 42 | to_vector4d: {EM_VECTOR4D}, 43 | 44 | to_tuple: {TUPLE[INTEGER, INTEGER, INTEGER, INTEGER]}, 45 | to_pointer: {POINTER} 46 | 47 | end 48 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/em_9_datastructures/em_vector4i_array.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "A C-Array for 4D-Vectors" 3 | documentation: "Wraps EM_VECTOR_3D to a c-array" 4 | date: "$Date: 2006/10/17 22:27:36 $" 5 | revision: "$Revision: 1.2 $" 6 | 7 | class EM_VECTOR4I_ARRAY 8 | 9 | inherit 10 | EM_ABSTRACT_VECTOR4_ARRAY[INTEGER, EM_VECTOR4I] 11 | 12 | create 13 | make 14 | 15 | convert 16 | to_c_pointer: {POINTER} 17 | 18 | feature -- Access 19 | 20 | item alias "[]", infix "@" (i: INTEGER): EM_VECTOR4I assign put is 21 | -- Entry at index `i', if in index interval 22 | do 23 | Result := [ area.item (i* dimension + 0), area.item (i*dimension + 1), area.item(i*dimension + 2), area.item(i*dimension + 3) ] 24 | end 25 | 26 | end -- class EM_VECTOR_4I_ARRAY 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_3d_cluster.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TE_3D_CLUSTER inherit 9 | 10 | TE_3D_SHARED_GLOBALS 11 | 12 | create 13 | make, make_with_default_material 14 | 15 | feature -- Initialize 16 | 17 | make(a_material: TE_MATERIAL) is 18 | -- create the cluster 19 | do 20 | create faces.make 21 | material := a_material 22 | end 23 | 24 | make_with_default_material is 25 | -- creates the cluster with a reference to the default material 26 | do 27 | create faces.make 28 | material := default_material 29 | end 30 | 31 | 32 | 33 | feature -- Access 34 | 35 | faces: LINKED_LIST[INTEGER] 36 | 37 | material: TE_MATERIAL 38 | 39 | feature -- Measurement 40 | 41 | feature -- Status report 42 | 43 | feature -- Status setting 44 | 45 | feature -- Cursor movement 46 | 47 | feature -- Element change 48 | 49 | set_faces(some_faces: LINKED_LIST[INTEGER]) is 50 | -- sets the face_list 51 | do 52 | faces := some_faces 53 | end 54 | 55 | set_material(a_material: TE_MATERIAL) is 56 | -- sets the material 57 | do 58 | material := a_material 59 | end 60 | 61 | clear_faces is 62 | -- sets the face_list to an empty list 63 | local 64 | new_faces: LINKED_LIST[INTEGER] 65 | do 66 | create new_faces.make 67 | faces := new_faces 68 | end 69 | 70 | push_index (a_index: INTEGER) is 71 | -- pushes a face_index at the end of the face_list 72 | do 73 | faces.extend(a_index) 74 | end 75 | 76 | 77 | 78 | feature -- Removal 79 | 80 | feature -- Resizing 81 | 82 | feature -- Transformation 83 | 84 | feature -- Conversion 85 | 86 | feature -- Duplication 87 | 88 | feature -- Miscellaneous 89 | 90 | feature -- Basic operations 91 | 92 | feature -- Obsolete 93 | 94 | feature -- Inapplicable 95 | 96 | feature {NONE} -- Implementation 97 | 98 | invariant 99 | invariant_clause: True -- Your invariant here 100 | 101 | end 102 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_3d_infinite_light.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TE_3D_INFINITE_LIGHT inherit 9 | 10 | TE_3D_LIGHT_SOURCE 11 | 12 | create 13 | make, make_as_child 14 | 15 | feature -- Access 16 | 17 | light_position: GL_VECTOR_4D[REAL] is 18 | -- returns the position of the node as GL_VECTOR_4D with the last component either 0.0 or 1.0 - 0.0 being an infinite (direct) light and 1.0 a position light 19 | local 20 | position:EM_VECTOR3D 21 | do 22 | position := world_transform.position 23 | create Result.make_xyzt(position.x, position.y, position.z, 0.0) 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_3d_member_factory_fromfile.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | deferred class 8 | TE_3D_MEMBER_FACTORY_FROMFILE inherit 9 | 10 | TE_3D_MEMBER_FACTORY 11 | 12 | feature -- 3D Member Creation 13 | 14 | create_3d_member_from_file(a_filename: STRING) is 15 | -- creates a 3D member from a file 16 | deferred 17 | end 18 | 19 | 20 | invariant 21 | invariant_clause: True -- Your invariant here 22 | 23 | end 24 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_3d_scene_importer.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TE_3D_SCENE_IMPORTER 9 | 10 | create 11 | make 12 | 13 | feature {TE_3D_SHARED_GLOBALS} -- Initialization 14 | 15 | make is 16 | -- creates the scene importer and the factory hastable 17 | do 18 | create factory_table.make(1) 19 | factory_table.put(create {TE_3D_MEMBER_FACTORY_FROMFILE_OBJ}, "obj") 20 | end 21 | 22 | 23 | feature -- Member Import 24 | 25 | import_3d_scene(a_filename:STRING): TE_3D_NODE is 26 | -- imports a 3d scene from a file 27 | -- depending on what is stored in that file it will return any decendant of TE_3D_NODE or the root of a hirarchy of them 28 | local 29 | factory: TE_3D_MEMBER_FACTORY_FROMFILE 30 | do 31 | factory := factory_table.item(a_filename.substring (a_filename.count - 2, a_filename.count)) 32 | factory.create_3d_member_from_file(a_filename) 33 | Result := factory.last_3d_member 34 | end 35 | 36 | 37 | feature -- Factory Table 38 | 39 | factory_table: HASH_TABLE[TE_3D_MEMBER_FACTORY_FROMFILE, STRING] 40 | 41 | feature -- Status report 42 | 43 | feature -- Status setting 44 | 45 | feature -- Cursor movement 46 | 47 | feature -- Element change 48 | 49 | feature -- Removal 50 | 51 | feature -- Resizing 52 | 53 | feature -- Transformation 54 | 55 | feature -- Conversion 56 | 57 | feature -- Duplication 58 | 59 | feature -- Miscellaneous 60 | 61 | feature -- Basic operations 62 | 63 | feature -- Obsolete 64 | 65 | feature -- Inapplicable 66 | 67 | feature {NONE} -- Implementation 68 | 69 | invariant 70 | invariant_clause: True -- Your invariant here 71 | 72 | end 73 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_3d_shared_globals.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TE_3D_SHARED_GLOBALS 9 | 10 | feature -- Singleton access 11 | 12 | root: TE_3D_NODE is 13 | -- root singleton 14 | once 15 | create Result.make_as_root 16 | ensure 17 | root_not_void: Result /= Void 18 | end 19 | 20 | default_material : TE_MATERIAL_SIMPLE 21 | --default material singleton 22 | once 23 | create Result.make 24 | ensure 25 | default_material_not_void: Result /= Void 26 | end 27 | 28 | scene_importer : TE_3D_SCENE_IMPORTER 29 | --scene importer to load 3d content from files 30 | once 31 | create Result.make 32 | ensure 33 | scene_importer_not_void: Result /= Void 34 | end 35 | 36 | renderpass_manager: TE_RENDERPASS_MANAGER is 37 | -- Bitamp factory singleton 38 | once 39 | create Result.make 40 | ensure 41 | renderpass_manager_not_void: Result /= Void 42 | end 43 | 44 | invariant 45 | root_MUST_NOT_BE_MOVED: root.transform.position.x = 0 and root.transform.position.y = 0 and root.transform.position.z = 0 46 | 47 | end 48 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_3d_target_camera.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TE_3D_TARGET_CAMERA inherit 9 | 10 | TE_3D_CAMERA 11 | 12 | feature -- Access 13 | 14 | feature -- Measurement 15 | 16 | camera_target: TE_3D_NODE 17 | -- 3d_node, the camera is pointing at, if target_cam is enabled 18 | 19 | feature -- Status report 20 | 21 | feature -- Status setting 22 | 23 | feature -- Cursor movement 24 | 25 | feature -- Element change 26 | 27 | feature -- Removal 28 | 29 | feature -- Resizing 30 | 31 | feature -- Transformation 32 | 33 | feature -- Conversion 34 | 35 | feature -- Duplication 36 | 37 | feature -- Miscellaneous 38 | 39 | feature -- Basic operations 40 | 41 | feature -- Obsolete 42 | 43 | feature -- Inapplicable 44 | 45 | feature {NONE} -- Implementation 46 | 47 | invariant 48 | invariant_clause: True -- Your invariant here 49 | 50 | end 51 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_gl_value.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "[ 3 | 4 | like GL_VECTOR_3D, this is a value that can be used with OpenGL. 5 | Note: this is a simple implementation which doesn't allow any mathematics. 6 | 7 | ]" 8 | date: "$Date: 2005/09/05 11:08:11 $" 9 | revision: "$Revision: 1.1 $" 10 | 11 | class 12 | TE_GL_VALUE [G] 13 | 14 | inherit 15 | ANY 16 | redefine 17 | out 18 | end 19 | 20 | DEBUG_OUTPUT 21 | redefine 22 | out 23 | end 24 | 25 | create 26 | make 27 | 28 | feature {NONE} -- Initialisation 29 | 30 | make (a_value: G) is 31 | -- Initialise `Current' with value a_value 32 | require 33 | a_value_not_void: a_value /= Void 34 | do 35 | create array.make (0, 0) 36 | set_value (a_value) 37 | ensure 38 | value_set: value = a_value 39 | end 40 | 41 | make_from_other (other: like Current) is 42 | -- Initialise `Current' with values from `other'. 43 | require 44 | other_not_void: other /= Void 45 | do 46 | make (other.value) 47 | ensure 48 | value_set: value = other.value 49 | end 50 | 51 | feature -- Access 52 | 53 | value: G is 54 | -- First element 55 | do 56 | Result := array @ (0) 57 | ensure 58 | result_exists: Result /= Void 59 | end 60 | 61 | pointer: POINTER is 62 | -- Pointer to `Current' which can be used in OpenGL 63 | local 64 | tmp: ANY 65 | do 66 | tmp := array.to_c 67 | Result := $tmp 68 | end 69 | 70 | feature -- Element change 71 | 72 | set_value (a_value: G) is 73 | -- Set value to a_value. 74 | require 75 | a_value_void: a_value /= Void 76 | do 77 | array.put (a_value, 0) 78 | ensure 79 | value_set: value = a_value 80 | end 81 | 82 | feature -- Support 83 | 84 | out, debug_output: STRING is 85 | -- Convert to string. 86 | do 87 | create Result.make_from_string (value.out) 88 | end 89 | 90 | feature {NONE} -- Implementation 91 | 92 | array: ARRAY [G] 93 | -- The array to hold the elements 94 | 95 | end 96 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_material.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | deferred class 8 | TE_MATERIAL 9 | 10 | feature -- Initialization 11 | 12 | make is 13 | -- create the material with default vaules 14 | do 15 | create name.make_empty 16 | create specify_material_pass.make(0) 17 | end 18 | 19 | 20 | feature -- Access 21 | 22 | name: STRING 23 | 24 | material_passes: INTEGER is 25 | -- how many material passes are defined in this material? 26 | do 27 | Result := specify_material_pass.count 28 | end 29 | 30 | 31 | feature -- Measurement 32 | 33 | feature -- Status report 34 | 35 | feature -- Status setting 36 | 37 | feature -- Cursor movement 38 | 39 | feature -- Element change 40 | 41 | feature -- Removal 42 | 43 | feature -- Resizing 44 | 45 | feature -- Transformation 46 | 47 | feature -- Conversion 48 | 49 | feature -- Duplication 50 | 51 | feature -- Miscellaneous 52 | 53 | feature -- Basic operations 54 | 55 | specify_material_pass: ARRAYED_LIST[EM_EVENT_CHANNEL[TUPLE[]]] 56 | -- add for each material_pass an event channel to the list and subscribe the corresponding feature to the event channel 57 | 58 | feature -- Obsolete 59 | 60 | feature -- Inapplicable 61 | 62 | feature -- Implementation 63 | 64 | remove is 65 | -- removes the mateiral. use glPushAtrib and glPopAtrib 66 | deferred 67 | end 68 | 69 | 70 | 71 | invariant 72 | at_least_one_material_pass: specify_material_pass.count >=1 -- Your invariant here 73 | end 74 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_material_simple.e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/library/visualization/em/visualization_3d/new/te_material_simple.e -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/new/te_renderpass.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | deferred class 8 | TE_RENDERPASS 9 | 10 | feature -- Initialization 11 | 12 | make is 13 | -- creates the pass 14 | do 15 | enabled := true 16 | end 17 | 18 | 19 | feature -- Access 20 | 21 | name: STRING 22 | 23 | enabled: BOOLEAN 24 | 25 | feature -- Measurement 26 | 27 | feature -- Status report 28 | 29 | feature -- Status setting 30 | 31 | enable is 32 | -- enables the pass 33 | do 34 | enabled := true 35 | end 36 | 37 | disable is 38 | -- disables the pass 39 | do 40 | enabled := false 41 | end 42 | 43 | feature -- Cursor movement 44 | 45 | feature -- Element change 46 | 47 | feature -- Removal 48 | 49 | feature -- Resizing 50 | 51 | feature -- Transformation 52 | 53 | feature -- Conversion 54 | 55 | feature -- Duplication 56 | 57 | feature -- Miscellaneous 58 | 59 | feature -- Basic operations 60 | 61 | feature -- Obsolete 62 | 63 | feature -- Inapplicable 64 | 65 | feature {TE_RENDERPASS_MANAGER} -- Implementation 66 | 67 | render is 68 | -- renders the current pass 69 | deferred 70 | end 71 | 72 | 73 | invariant 74 | invariant_clause: True -- Your invariant here 75 | 76 | end 77 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/nodes/traffic_3d_daynight_renderable.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TRAFFIC_3D_DAYNIGHT_RENDERABLE [G] 9 | 10 | inherit 11 | TRAFFIC_3D_RENDERABLE [G] 12 | rename 13 | make as make_with_item_orig 14 | redefine 15 | render_node 16 | end 17 | 18 | TRAFFIC_SHARED_TIME 19 | 20 | create 21 | make_with_item 22 | 23 | feature -- Initialization 24 | 25 | make_with_item (a_item: G; a_day_graphical, a_night_graphical: TE_3D_NODE) is 26 | -- Initialize. 27 | require 28 | a_item_not_void: a_item /= Void 29 | a_day_graphical_not_empty: a_day_graphical /= Void 30 | a_night_graphical_not_empty: a_night_graphical /= Void 31 | do 32 | make_with_item_orig (a_item) 33 | day_graphical := a_day_graphical 34 | day_graphical.set_as_child_of (Current) 35 | 36 | night_graphical := a_night_graphical 37 | night_graphical.set_as_child_of (Current) 38 | -- day_graphical.transform.set_scaling (50, 50, 50) 39 | -- night_graphical.transform.set_scaling (50, 50, 50) 40 | 41 | -- TODO: randomize 42 | create night_start.make (19, 0, 0) 43 | create day_start.make (6, 0, 0) 44 | end 45 | 46 | feature -- Access 47 | 48 | day_graphical: TE_3D_NODE 49 | 50 | night_graphical: TE_3D_NODE 51 | 52 | night_start: TIME 53 | 54 | day_start: TIME 55 | 56 | feature -- Basic operations 57 | 58 | render_node is 59 | -- Update the position before the node is rendered. 60 | local 61 | is_night: BOOLEAN 62 | do 63 | if night_start < day_start then 64 | if time.actual_time > night_start and time.actual_time < day_start then 65 | is_night := True 66 | else 67 | is_night := False 68 | end 69 | else 70 | if time.actual_time > day_start and time.actual_time < night_start then 71 | is_night := False 72 | else 73 | is_night := True 74 | end 75 | end 76 | if is_night then 77 | day_graphical.disable_hierarchy_renderable 78 | night_graphical.enable_hierarchy_renderable 79 | else 80 | night_graphical.disable_hierarchy_renderable 81 | day_graphical.enable_hierarchy_renderable 82 | end 83 | end 84 | 85 | end 86 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/nodes/traffic_3d_moving_daynight_renderable.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TRAFFIC_3D_MOVING_DAYNIGHT_RENDERABLE [G -> TRAFFIC_MOVING] 9 | 10 | inherit 11 | TRAFFIC_3D_RENDERABLE [G] 12 | rename 13 | make as make_with_item_orig 14 | redefine 15 | render_node 16 | end 17 | 18 | create 19 | make_with_item 20 | 21 | feature -- Initialization 22 | 23 | make_with_item (a_item: G; a_day_graphical, a_night_graphical: TE_3D_NODE) is 24 | -- Initialize. 25 | require 26 | a_item_not_void: a_item /= Void 27 | a_day_graphical_not_empty: a_day_graphical /= Void 28 | a_night_graphical_not_empty: a_night_graphical /= Void 29 | do 30 | make_with_item_orig (a_item) 31 | day_graphical := a_day_graphical 32 | day_graphical.set_as_child_of (Current) 33 | 34 | night_graphical := a_night_graphical 35 | night_graphical.set_as_child_of (Current) 36 | 37 | -- TODO: randomize 38 | create night_start.make (19, 0, 0) 39 | create day_start.make (6, 0, 0) 40 | end 41 | 42 | feature -- Access 43 | 44 | day_graphical: TE_3D_NODE 45 | 46 | night_graphical: TE_3D_NODE 47 | 48 | night_start: TIME 49 | 50 | day_start: TIME 51 | 52 | feature -- Basic operations 53 | 54 | render_node is 55 | -- Update the position before the node is rendered. 56 | local 57 | is_night: BOOLEAN 58 | do 59 | if night_start < day_start then 60 | if item.time.actual_time > night_start and item.time.actual_time < day_start then 61 | is_night := True 62 | else 63 | is_night := False 64 | end 65 | else 66 | if item.time.actual_time > day_start and item.time.actual_time < night_start then 67 | is_night := False 68 | else 69 | is_night := True 70 | end 71 | end 72 | if is_night then 73 | day_graphical.disable_hierarchy_renderable 74 | night_graphical.enable_hierarchy_renderable 75 | night_graphical.transform.set_rotation(0,1.0,0,-item.angle_x) 76 | night_graphical.transform.set_position (item.position.x, 0, item.position.y) 77 | else 78 | night_graphical.disable_hierarchy_renderable 79 | day_graphical.enable_hierarchy_renderable 80 | day_graphical.transform.set_rotation(0,1.0,0,-item.angle_x) 81 | day_graphical.transform.set_position (item.position.x, 0, item.position.y) 82 | end 83 | end 84 | 85 | end 86 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/nodes/traffic_3d_moving_renderable.e: -------------------------------------------------------------------------------- 1 | 2 | indexing 3 | description: "Objects that ..." 4 | author: "" 5 | date: "$Date$" 6 | revision: "$Revision$" 7 | 8 | class 9 | TRAFFIC_3D_MOVING_RENDERABLE [G -> TRAFFIC_MOVING] 10 | 11 | inherit 12 | 13 | TRAFFIC_3D_RENDERABLE [G] 14 | redefine 15 | render_node 16 | end 17 | 18 | create 19 | make 20 | 21 | feature -- 22 | 23 | render_node is 24 | -- Update the position before the node is rendered. 25 | 26 | -- O_o' 27 | do 28 | transform.set_rotation(0.0, 1.0, 0.0,-item.angle_x) 29 | transform.set_position (item.position.x, 0, item.position.y) 30 | Precursor 31 | end 32 | 33 | end 34 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/nodes/traffic_3d_place_factory.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Factory for creating place representations" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_3D_PLACE_FACTORY inherit 8 | 9 | TE_3D_MEMBER_FACTORY_PRIMITIVE 10 | redefine 11 | make 12 | end 13 | 14 | TRAFFIC_CONSTANTS 15 | 16 | create make 17 | 18 | feature -- Initialization 19 | 20 | make is 21 | -- makes factory and sets the color to black 22 | local 23 | default_material: TE_MATERIAL_SIMPLE 24 | do 25 | create default_material.make_with_color(1.0,1.0,1.0) 26 | set_material(default_material) 27 | end 28 | 29 | feature -- Basic operations 30 | 31 | new_place_member (a_place: TRAFFIC_PLACE): TRAFFIC_3D_RENDERABLE [TRAFFIC_PLACE] is 32 | -- Creates a representation for `a_place' using the available material. 33 | require 34 | a_place_not_void: a_place /= void 35 | local 36 | border: DOUBLE 37 | do 38 | border := 4.0 39 | create_simple_plane (a_place.width+border, a_place.breadth+border) 40 | create Result.make (a_place) 41 | Result.add_child (last_3d_member) 42 | Result.transform.set_position (a_place.position.x, 0.07, a_place.position.y) 43 | ensure 44 | Result_exists: Result /= Void 45 | end 46 | 47 | end 48 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/traffic_3d_map_widget.e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/library/visualization/em/visualization_3d/traffic_3d_map_widget.e -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/traffic_3d_scene.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Default scene with a map widget and buttons for opening an xml, zooming in and out" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_3D_SCENE 8 | 9 | inherit 10 | 11 | TRAFFIC_EM_SCENE 12 | redefine 13 | map_widget 14 | end 15 | 16 | 17 | creation 18 | make 19 | 20 | feature {NONE} -- Initialization 21 | 22 | build_map_widget is 23 | -- 24 | do 25 | if video_subsystem.opengl_enabled then 26 | create map_widget.make_with_size (width, height - 30) 27 | map_widget.set_position (0, 30) 28 | map_widget.mouse_dragged_event.subscribe (agent rotate_zoom_pan (?)) 29 | map_widget.mouse_wheel_up_event.subscribe (agent map_widget.zoom_in) 30 | map_widget.mouse_wheel_down_event.subscribe (agent map_widget.zoom_out) 31 | map_widget.mouse_clicked_event.subscribe (agent click(?)) 32 | add_component (map_widget) 33 | else 34 | io.put_string ("OpenGL disabled: Map not loaded%N") 35 | end 36 | end 37 | 38 | set_agents is 39 | -- Set the agents for the zoom in and zoom out buttons. 40 | do 41 | zoom_out_button.clicked_event.subscribe (agent zoom_out_button_clicked) 42 | zoom_in_button.clicked_event.subscribe (agent zoom_in_button_clicked) 43 | end 44 | 45 | feature -- Event handling 46 | 47 | click (an_event: EM_MOUSEBUTTON_EVENT) is 48 | -- 49 | do 50 | if an_event.is_right_button then 51 | --don't know yet 52 | elseif an_event.is_middle_button then 53 | --don't know yet 54 | elseif an_event.is_left_button then 55 | map_widget.pick_selection(an_event.screen_x, an_event.screen_y) 56 | end 57 | end 58 | 59 | rotate_zoom_pan (an_event: EM_MOUSEMOTION_EVENT) is 60 | -- Rotate camera around 61 | do 62 | if an_event.button_state_right then 63 | map_widget.rotate_camera (an_event.x_motion, an_event.y_motion) 64 | elseif an_event.button_state_middle then 65 | map_widget.zoom(an_event.y_motion) 66 | elseif an_event.button_state_left then 67 | map_widget.pan (an_event.x_motion, an_event.y_motion) 68 | end 69 | 70 | end 71 | 72 | zoom_in_button_clicked is 73 | -- "Zoom in" button has been clicked. 74 | require 75 | zoom_in_button /= Void 76 | do 77 | zoom_in_button.set_pressed (False) 78 | map_widget.zoom_in 79 | end 80 | 81 | zoom_out_button_clicked is 82 | -- "Zoom out" button has been clicked. 83 | require 84 | zoom_out_button /= Void 85 | do 86 | zoom_out_button.set_pressed (False) 87 | map_widget.zoom_out 88 | end 89 | 90 | feature -- Access 91 | 92 | map_widget: TRAFFIC_3D_MAP_WIDGET 93 | 94 | end 95 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/traffic_sun.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "The Sun" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_SUN 8 | inherit 9 | DOUBLE_MATH 10 | export {NONE} all end 11 | 12 | MATH_CONST 13 | export 14 | {NONE} all 15 | {ANY} pi 16 | end 17 | 18 | TRAFFIC_SHARED_TIME 19 | 20 | 21 | create 22 | make 23 | 24 | feature {NONE} -- Initialization 25 | 26 | make is 27 | -- Initialize `Current'. 28 | do 29 | theta := 0.6 30 | phi := 1.0 31 | radius := 20000.0 32 | time.add_callback_procedure (agent update) 33 | ensure 34 | -- coordinates_initialized : (theta = 0.6) and (phi = 1.0) and (radius = 50.0) 35 | end 36 | 37 | 38 | feature -- Access 39 | 40 | theta: DOUBLE 41 | -- Longitude (rad) 42 | 43 | phi: DOUBLE 44 | -- Colatitude (rad) 45 | 46 | radius: DOUBLE 47 | -- Radius 48 | 49 | position : GL_VECTOR_3D[DOUBLE] is 50 | -- Position of the sun in carthesian coordinates 51 | do 52 | create Result.make_xyz (radius*sine(theta)*cosine(phi), 53 | radius*sine(theta)*sine(phi), 54 | radius*cosine(theta)) 55 | ensure 56 | result_set: Result /= Void 57 | end 58 | 59 | feature -- Element change 60 | 61 | set_theta (new_theta: DOUBLE) is 62 | -- Set longitude to `new_theta'. 63 | require 64 | new_theta_valid: new_theta >= 0 and new_theta < 2*pi 65 | do 66 | theta := new_theta 67 | ensure 68 | new_theta_set: theta = new_theta 69 | end 70 | 71 | set_phi (new_phi: DOUBLE) is 72 | -- Set colatitude to `new_phi'. 73 | require 74 | new_phi_valid: new_phi >= 0 and new_phi < pi 75 | do 76 | phi := new_phi 77 | ensure 78 | new_phi_set: phi = new_phi 79 | end 80 | 81 | set_radius(new_radius: DOUBLE) is 82 | -- Set radius to `new_radius'. 83 | require 84 | new_radius_valid: new_radius >= 0 85 | do 86 | radius := new_radius 87 | ensure 88 | new_radius_set: radius = new_radius 89 | end 90 | 91 | update is 92 | -- Set Coordinates corresponding to time 93 | require 94 | time_exists: time /= Void 95 | do 96 | theta := (3*pi/2.0 + (2.0*pi*(time.actual_time.hour*3600.0 + time.actual_time.minute*60.0 + time.actual_time.second))/(24.0*60.0*60.0)) 97 | if theta >= 2*pi then 98 | theta := theta - 2*pi 99 | end 100 | ensure 101 | theta_valid: theta >= 0 and theta < 2*pi 102 | end 103 | 104 | invariant 105 | longitude_valid: theta >= 0 and theta < 2*pi 106 | colatitude_valid: phi >= 0 and phi < pi 107 | radius_valid: radius >= 0 108 | end 109 | -------------------------------------------------------------------------------- /library/visualization/em/visualization_3d/traffic_time_counter.e: -------------------------------------------------------------------------------- 1 | indexing 2 | description: "Objects that ..." 3 | author: "" 4 | date: "$Date$" 5 | revision: "$Revision$" 6 | 7 | class 8 | TRAFFIC_TIME_COUNTER 9 | 10 | inherit 11 | 12 | EM_FRAME_COUNTER 13 | rename 14 | update_fps as update_time, 15 | time as em_time 16 | redefine 17 | make, 18 | update_time 19 | end 20 | 21 | TRAFFIC_SHARED_TIME 22 | 23 | create 24 | make 25 | 26 | feature -- Initialization 27 | 28 | make is 29 | -- Initialize time counter. 30 | do 31 | Precursor 32 | str.set_value("??:??:??") 33 | end 34 | 35 | feature {NONE} -- Implementation 36 | 37 | update_time is 38 | -- Update with new time 39 | do 40 | str.set_value(time.out) 41 | end 42 | 43 | end 44 | -------------------------------------------------------------------------------- /library/visualization/traffic_view.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "View for a city item" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_VIEW [G] 8 | 9 | feature -- Initialization 10 | 11 | make (a_item: G) 12 | -- Set `item' to `a_item'. 13 | require 14 | a_item_exists: a_item /= Void 15 | deferred 16 | ensure 17 | item_set: item = a_item 18 | is_shown: is_shown 19 | not_highlighted: not is_highlighted 20 | end 21 | 22 | feature -- Access 23 | 24 | item: G 25 | -- Item the view represents 26 | 27 | color: TRAFFIC_COLOR 28 | -- Color for displaying 29 | 30 | highlight_color: TRAFFIC_COLOR 31 | -- Highlight color 32 | 33 | feature -- Status setting 34 | 35 | set_color (a_color: TRAFFIC_COLOR) 36 | -- Set the color of the view to `a_color'. 37 | deferred 38 | end 39 | 40 | set_highlight_color (a_color: TRAFFIC_COLOR) 41 | -- Set the color of the view to `a_color'. 42 | deferred 43 | end 44 | 45 | feature -- Basic operations 46 | 47 | update 48 | -- Update `Current' to reflect changes in `item'. 49 | deferred 50 | end 51 | 52 | highlight 53 | -- Highlight the view. 54 | deferred 55 | ensure 56 | highlighted: is_highlighted 57 | end 58 | 59 | unhighlight 60 | -- Unhighlight the view. 61 | deferred 62 | ensure 63 | not_highlighted: not is_highlighted 64 | end 65 | 66 | hide 67 | -- Hide the view. 68 | deferred 69 | ensure 70 | hidden: not is_shown 71 | end 72 | 73 | show 74 | -- Show the view. 75 | deferred 76 | ensure 77 | shown: is_shown 78 | end 79 | 80 | feature -- Status report 81 | 82 | is_highlighted: BOOLEAN 83 | -- Is the view highlighted? 84 | deferred 85 | end 86 | 87 | is_shown: BOOLEAN 88 | -- Is the view shown? 89 | deferred 90 | end 91 | 92 | feature -- Element change 93 | 94 | set_item (a_item: like item) 95 | -- Set `item' to `a_item'. 96 | require 97 | a_item_exists: a_item /= Void 98 | do 99 | item := a_item 100 | ensure 101 | item_set: item = a_item 102 | end 103 | 104 | end 105 | -------------------------------------------------------------------------------- /library/visualization/vision2/time/traffic_shared_time.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Singleton that simulates time of the day" 3 | date: "$Date$" 4 | 5 | class 6 | TRAFFIC_SHARED_TIME 7 | 8 | feature -- Access 9 | 10 | time: TRAFFIC_TIME 11 | -- Time singleton that simulates a day 12 | once 13 | create {TRAFFIC_VISION2_TIME} Result.make_with_speedup (2) 14 | ensure 15 | Result_exists: Result /= Void 16 | end 17 | 18 | end 19 | -------------------------------------------------------------------------------- /library/visualization/vision2/time/traffic_vision2_time.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Timing facilities with vision2" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_VISION2_TIME 8 | 9 | inherit 10 | 11 | TRAFFIC_TIME 12 | 13 | create 14 | make_with_speedup 15 | 16 | feature -- Basic operations 17 | 18 | start 19 | -- Start to count the time at (0:0:0). 20 | local 21 | t: TIME 22 | do 23 | is_time_running := True 24 | application.add_idle_action (update_agent) 25 | create t.make_now 26 | real_ms_start := t.seconds*1000 + t.milli_second 27 | simulated_ms_start := 0 28 | end 29 | 30 | pause 31 | -- Pause the time count. 32 | do 33 | is_time_running := False 34 | application.remove_idle_action (update_agent) 35 | simulated_ms_start := actual_time.seconds*1000 36 | end 37 | 38 | resume 39 | -- Resume the paused time. 40 | local 41 | t: TIME 42 | do 43 | is_time_running := True 44 | application.add_idle_action (update_agent) 45 | create t.make_now 46 | real_ms_start := t.seconds*1000 + t.milli_second 47 | end 48 | 49 | reset 50 | -- Reset the time to (0:0:0). 51 | do 52 | actual_time.set_hour (0) 53 | actual_time.set_minute (0) 54 | actual_time.set_second (0) 55 | is_time_running := False 56 | real_ms_start := 0 57 | simulated_ms_start := 0 58 | end 59 | 60 | feature{NONE} -- Implementation 61 | 62 | update_time 63 | -- Update the time count 64 | local 65 | real_ms: INTEGER 66 | sim_ms: INTEGER 67 | t: TIME 68 | do 69 | if is_time_running then 70 | create t.make_now 71 | real_ms := t.seconds*1000 + t.milli_second - real_ms_start 72 | sim_ms := speedup*real_ms + simulated_ms_start 73 | if sim_ms//1000 >= actual_time.seconds_in_day then 74 | real_ms_start := t.seconds*1000 + t.milli_second 75 | sim_ms := (sim_ms//1000)\\actual_time.seconds_in_day 76 | simulated_ms_start := sim_ms 77 | actual_day := actual_day + 1 78 | actual_time.make_by_seconds (sim_ms) 79 | else 80 | actual_time.make_by_seconds (sim_ms//1000) 81 | actual_time.set_fractionals ((sim_ms\\1000)/1000) 82 | end 83 | call_tours 84 | call_procedure 85 | end 86 | end 87 | 88 | application: EV_APPLICATION 89 | -- Application 90 | once 91 | Result := (create {EV_ENVIRONMENT}).application 92 | end 93 | 94 | end 95 | -------------------------------------------------------------------------------- /library/visualization/vision2/touch/traffic_console.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Traffic console for output in examples" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_CONSOLE 8 | 9 | inherit 10 | 11 | EV_TEXT 12 | rename 13 | show as display 14 | export 15 | {ANY} append_text, prepend_text, remove_text 16 | end 17 | 18 | create 19 | make_with_text, 20 | default_create 21 | 22 | feature -- Text changes 23 | 24 | show (an_object: ANY) 25 | -- Display information on `an_object'. 26 | require 27 | an_object_exists: an_object /= Void 28 | do 29 | append_text ("%N" + an_object.out) 30 | end 31 | 32 | end 33 | -------------------------------------------------------------------------------- /library/visualization/vision2/traffic_vs_view_container.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Container for vision2 city item views" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_VS_VIEW_CONTAINER [G] 8 | 9 | inherit 10 | 11 | TRAFFIC_VIEW_CONTAINER [G, TRAFFIC_VS_VIEW [G]] 12 | undefine 13 | show, 14 | hide 15 | end 16 | 17 | DRAWABLE_OBJECT_CONTAINER [TRAFFIC_VS_VIEW [G]] 18 | 19 | create 20 | make 21 | 22 | end 23 | -------------------------------------------------------------------------------- /library/visualization/vision2/views/traffic_building_view.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "View for buildings, subclasses make this class effective" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_BUILDING_VIEW 8 | 9 | inherit 10 | 11 | TRAFFIC_VS_VIEW [TRAFFIC_BUILDING] 12 | undefine 13 | copy, 14 | is_equal, 15 | show, 16 | hide, 17 | draw 18 | end 19 | 20 | DRAWABLE_OBJECT_CONTAINER [DRAWABLE_OBJECT] 21 | rename 22 | color as internal_color, 23 | set_color as set_internal_color, 24 | make as make_container, 25 | item as container_item 26 | export {NONE} 27 | internal_color, 28 | set_internal_color, 29 | make_container 30 | redefine 31 | draw_object 32 | end 33 | 34 | feature -- Initialization 35 | 36 | make (a_item: like item) 37 | -- Initialize view for `a_item'. 38 | do 39 | item := a_item 40 | make_container 41 | define 42 | is_shown := True 43 | is_highlighted := False 44 | item.changed_event.subscribe (agent update) 45 | ensure then 46 | internal_color_exists: internal_color /= Void 47 | end 48 | 49 | feature -- Constants 50 | 51 | default_color: EV_COLOR 52 | -- Default color 53 | once 54 | create Result.make_with_8_bit_rgb (200, 200, 200) 55 | end 56 | 57 | default_highlight_color: EV_COLOR 58 | -- Default highlight color 59 | once 60 | create Result.make_with_8_bit_rgb (255, 0, 0) 61 | end 62 | 63 | feature{EV_CANVAS} -- Display 64 | 65 | draw_object 66 | -- Draws the rectangle. 67 | do 68 | if is_shown then 69 | Precursor 70 | end 71 | end 72 | 73 | feature {NONE} -- Implementation 74 | 75 | define 76 | -- Define the objects in the container. 77 | deferred 78 | end 79 | 80 | end 81 | -------------------------------------------------------------------------------- /library/visualization/vision2/views/traffic_moving_deferred_view.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "View for movings, subclasses make this class effective" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_MOVING_DEFERRED_VIEW [G->TRAFFIC_MOVING] 8 | 9 | inherit 10 | 11 | TRAFFIC_VS_VIEW [G] 12 | undefine 13 | copy, 14 | is_equal, 15 | show, 16 | hide, 17 | draw 18 | end 19 | 20 | DRAWABLE_OBJECT_CONTAINER [DRAWABLE_OBJECT] 21 | rename 22 | color as internal_color, 23 | set_color as set_internal_color, 24 | make as make_container, 25 | item as container_item 26 | export {NONE} 27 | internal_color, 28 | set_internal_color, 29 | make_container 30 | redefine 31 | draw_object 32 | end 33 | 34 | feature -- Initialization 35 | 36 | make (a_item: like item) 37 | -- Initialize view for `a_item'. 38 | do 39 | item := a_item 40 | make_container 41 | define 42 | is_shown := True 43 | is_highlighted := False 44 | item.changed_event.subscribe (agent update) 45 | ensure then 46 | internal_color_exists: internal_color /= Void 47 | end 48 | 49 | feature -- Constants 50 | 51 | default_color: EV_COLOR 52 | -- Default color 53 | deferred 54 | end 55 | 56 | default_highlight_color: EV_COLOR 57 | -- Default highlight color 58 | deferred 59 | end 60 | 61 | feature{EV_CANVAS} -- Display 62 | 63 | draw_object 64 | -- Draws the rectangle. 65 | do 66 | if is_shown then 67 | Precursor 68 | end 69 | end 70 | 71 | feature {NONE} -- Implementation 72 | 73 | define 74 | -- Define the objects in the container. 75 | deferred 76 | end 77 | 78 | end 79 | -------------------------------------------------------------------------------- /library/visualization/vision2/views/traffic_moving_view.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "View for moving items such as trams, passengers, etc." 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | TRAFFIC_MOVING_VIEW [G->TRAFFIC_MOVING] 8 | 9 | inherit 10 | 11 | TRAFFIC_VS_VIEW [G] 12 | undefine 13 | invalidate 14 | end 15 | 16 | DRAWABLE_CIRCLE 17 | rename 18 | color as internal_color, 19 | set_color as set_internal_color, 20 | make as make_circle 21 | export {NONE} 22 | internal_color, 23 | set_internal_color, 24 | make_circle 25 | redefine 26 | invalidate, 27 | draw_object 28 | end 29 | 30 | create 31 | make 32 | 33 | feature -- Initialization 34 | 35 | make (a_item: like item) 36 | -- Initialize view for `a_item'. 37 | do 38 | item := a_item 39 | make_circle (create {REAL_COORDINATE}.make (a_item.location.x, -a_item.location.y)) 40 | set_diameter (10) 41 | set_internal_color (default_color) 42 | enable_filled 43 | is_shown := True 44 | is_highlighted := False 45 | ensure then 46 | internal_color_exists: internal_color /= Void 47 | end 48 | 49 | feature -- Basic operations 50 | 51 | update 52 | -- Update to reflect changes in city item. 53 | do 54 | if item.is_highlighted then 55 | highlight 56 | else 57 | unhighlight 58 | end 59 | end 60 | 61 | feature -- Constants 62 | 63 | default_color: EV_COLOR 64 | -- Default color 65 | once 66 | create Result.make_with_8_bit_rgb (255, 255, 0) 67 | end 68 | 69 | default_highlight_color: EV_COLOR 70 | -- Default highlight color 71 | once 72 | create Result.make_with_8_bit_rgb (255, 0, 0) 73 | end 74 | 75 | feature {NONE} -- Implementation 76 | 77 | draw_object 78 | -- Draw the circle. 79 | do 80 | set_center (create {REAL_COORDINATE}.make (item.location.x, -item.location.y)) 81 | Precursor 82 | end 83 | 84 | invalidate 85 | -- Some property of `Current' has changed. 86 | do 87 | is_valid := False 88 | end 89 | 90 | end 91 | -------------------------------------------------------------------------------- /library/visualization/vision2/views/traffic_vs_view.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Deferred class for all vision2 city item views" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | deferred class 7 | TRAFFIC_VS_VIEW [G] 8 | 9 | inherit 10 | 11 | TRAFFIC_VIEW [G] 12 | 13 | DRAWABLE_OBJECT 14 | rename 15 | color as internal_color, 16 | set_color as set_internal_color 17 | end 18 | 19 | feature -- Obsolete 20 | 21 | is_highlighted: BOOLEAN 22 | 23 | feature -- Basic operations 24 | 25 | highlight 26 | -- Highlight the view. 27 | do 28 | if highlight_color /= Void then 29 | set_internal_color (create {EV_COLOR}.make_with_8_bit_rgb (highlight_color.red, highlight_color.green, highlight_color.blue)) 30 | else 31 | set_internal_color (default_highlight_color) 32 | end 33 | is_highlighted := True 34 | end 35 | 36 | unhighlight 37 | -- Unhighlight the view. 38 | do 39 | if color /= Void then 40 | set_internal_color (create {EV_COLOR}.make_with_8_bit_rgb (color.red, color.green, color.blue)) 41 | else 42 | set_internal_color (default_color) 43 | end 44 | is_highlighted := False 45 | end 46 | 47 | set_color (a_color: TRAFFIC_COLOR) 48 | -- Set the color of the view to `a_color'. 49 | do 50 | color := a_color 51 | if not is_highlighted then 52 | if color /= Void then 53 | set_internal_color (create {EV_COLOR}.make_with_8_bit_rgb (color.red, color.green, color.blue)) 54 | else 55 | set_internal_color (default_color) 56 | end 57 | end 58 | end 59 | 60 | set_highlight_color (a_color: TRAFFIC_COLOR) 61 | -- Set the color of the view to `a_color'. 62 | do 63 | highlight_color := a_color 64 | if is_highlighted then 65 | if highlight_color /= Void then 66 | set_internal_color (create {EV_COLOR}.make_with_8_bit_rgb (highlight_color.red, highlight_color.green, highlight_color.blue)) 67 | else 68 | set_internal_color (default_highlight_color) 69 | end 70 | end 71 | end 72 | 73 | feature -- Constants 74 | 75 | default_color: EV_COLOR 76 | -- Default color 77 | deferred 78 | end 79 | 80 | default_highlight_color: EV_COLOR 81 | -- Default highlight color 82 | deferred 83 | end 84 | 85 | end 86 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | TRAFFIC - City modeling library and applications 2 | Version 3.4 3 | 4 | 1. General 5 | 2. Requirements 6 | 3. Building an example 7 | 4. License 8 | 5. Thanks 9 | 10 | 1. General 11 | ____________________________________________________________ 12 | 13 | Traffic is a library that comes with many example applications. To use the Traffic 14 | library in your own projects, just include the library directory in your ecf file. 15 | The current version of Traffic uses Vision2 for visualization. 16 | 17 | 2. Requirements 18 | ____________________________________________________________ 19 | 20 | General: 21 | - EiffelStudio 19.12 for Linux and Windows 22 | - Vision2 (provided with ES 19.12) 23 | 24 | 3. Building an example 25 | ____________________________________________________________ 26 | 27 | Use one of the ecf files provided with the example applications under traffic/example. 28 | Open the ecf file in EiffelStudio, compile the project, and you will be ready to go! 29 | 30 | 4. License 31 | ____________________________________________________________ 32 | 33 | Eiffel Forum License, version 2, see forum.txt 34 | 35 | 5. Thanks 36 | ____________________________________________________________ 37 | 38 | Patrick Schoenbach, Susanne Cech, Rolf Bruderer, Marcel Kessler, Sibylle Aregger, 39 | Ursina Caluori, Roger Kueng, Valentin Wuestholz, Stefan David, Florian 40 | Geldmacher, Fabian Wueest, Susanne Kasper, Michele Croci, Sarah Hauser, Alan 41 | Fehr, Matthias Buehlmann, Adrian Helfenstein, Nicola Bizirianis, Michael Käser, 42 | Hans-Hermann Jonas, Lars Krapf, Etienne Reichenbach, Maria Husmann, Till Bay, 43 | Michela Pedroni, the team of the Chair of Software Engineering and the CS students 44 | of ETH Zurich 45 | 46 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/02_objects/preview.e: -------------------------------------------------------------------------------- 1 | class PREVIEW inherit 2 | TOURISM 3 | 4 | feature -- Explore Paris 5 | 6 | explore 7 | -- Show city info and a route. 8 | do 9 | Paris.display 10 | Louvre.spotlight 11 | Line8.highlight 12 | Route1.animate 13 | Console.show (Route1.origin) 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/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 | Paris.display 10 | Console.show (Line8.count) 11 | Console.show (Line8.i_th (1)) 12 | Console.show (Line8.i_th (2)) 13 | wait 14 | Line8.remove_all_segments 15 | Line8.extend (Station_La_Motte) 16 | Line8.extend (Station_Concorde) 17 | Line8.extend (Station_Invalides) 18 | Line8.highlight 19 | Console.show (Line8.count) 20 | Console.show (Line8.north_end.name) 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/06_creation/line_building.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Line building class (Chapter 6, Touch of Class)" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class LINE_BUILDING inherit 7 | 8 | TOURISM 9 | 10 | feature -- Line building 11 | 12 | build_a_line 13 | -- Build an imaginary line and highlight it on the map. 14 | do 15 | Paris.display 16 | 17 | create fancy_line.make_metro("FANCY") 18 | Paris.put_line (fancy_line) 19 | 20 | create stop1.set_station_and_line (Station_Montrouge, fancy_line) 21 | create stop2.set_station_and_line (Station_Issy, fancy_line) 22 | create stop3.set_station_and_line (station_balard, fancy_line) 23 | 24 | stop1.link (stop2) 25 | stop2.link (stop3) 26 | 27 | fancy_line.highlight 28 | end 29 | 30 | fancy_line: TRAFFIC_LINE 31 | stop1, stop2, stop3: TRAFFIC_STOP 32 | 33 | end 34 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/07_control/routes.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Routes class (Chapter 7, Touch of Class)" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | ROUTES 8 | 9 | inherit 10 | 11 | TOURISM 12 | 13 | feature -- Routes 14 | 15 | traverse 16 | -- Build a route and traverse Line8. 17 | do 18 | Paris.display 19 | 20 | -- Path 21 | create walking_1.make_walk (Elysee_palace, Station_Charles_de_Gaulle_Etoile) 22 | create metro_1.make_metro (Station_Charles_de_Gaulle_Etoile, Station_Champs_de_Mars_Tour_Eiffel_Bir_Hakeim) 23 | create walking_2.make_walk (Station_Champs_de_Mars_Tour_Eiffel_Bir_Hakeim, Eiffel_Tower) 24 | create full.make_empty 25 | full.extend (walking_1) 26 | full.extend (metro_1) 27 | full.extend (walking_2) 28 | Paris.routes.put_last (full) 29 | full.illuminate 30 | 31 | -- Loop 32 | from 33 | Line8.start 34 | invariant 35 | not_before_unless_empty: (not Line8.is_empty) implies (not Line8.is_before) 36 | -- "For all stations before cursor position, a spot has been displayed" 37 | variant 38 | Line8.count - Line8.index + 1 39 | until 40 | Line8.after 41 | loop 42 | if Line8.item.is_railway_connection then 43 | show_big_red_spot (Line8.item.location) 44 | elseif Line8.item.is_exchange then 45 | show_blinking_spot (Line8.item.location) 46 | else 47 | show_spot (Line8.item.location) 48 | end 49 | Line8.forth 50 | end 51 | end 52 | 53 | 54 | full: TRAFFIC_ROUTE 55 | walking_1, walking_2, metro_1: TRAFFIC_LEG 56 | 57 | end 58 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/08_routines/routes.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Routes class (Chapter 8, Touch of Class)" 3 | date: "$Date$" 4 | revision: "$Revision$" 5 | 6 | class 7 | ROUTES 8 | 9 | inherit 10 | 11 | TOURISM 12 | 13 | feature -- Traversing 14 | 15 | traverse 16 | -- Traverse Line8. 17 | do 18 | Paris.display 19 | 20 | from 21 | line8.start 22 | invariant 23 | not_before_unless_empty: (not Line8.is_empty) implies (not Line8.is_before) 24 | -- "For all stations before cursor position, a spot has been displayed" 25 | variant 26 | Line8.count - Line8.index + 1 27 | until 28 | line8.after 29 | loop 30 | show_station(line8.item) 31 | line8.forth 32 | end 33 | 34 | end 35 | 36 | show_station(s:TRAFFIC_STATION) 37 | -- Highlights s in a form adapted to its status 38 | require 39 | station_exists: s /= Void 40 | do 41 | if Line8.item.is_railway_connection then 42 | show_big_red_spot (Line8.item.location) 43 | elseif Line8.item.is_exchange then 44 | show_blinking_spot (Line8.item.location) 45 | else 46 | show_spot (line8.item.location) 47 | end 48 | end 49 | 50 | 51 | feature -- Access 52 | 53 | end 54 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/09_variables/assignments.e: -------------------------------------------------------------------------------- 1 | note 2 | description: "Variables, Assignment and References (Chapter 9, Touch of Class)" 3 | author: "Corinne Mueller" 4 | date: "10.01.2008" 5 | revision: "1.0.0" 6 | 7 | class 8 | ASSIGNMENTS 9 | 10 | inherit 11 | 12 | TOURISM 13 | 14 | feature -- Path building 15 | 16 | startup 17 | 18 | do 19 | paris.display 20 | console.show (highest_name (Line8)) 21 | console.show (total_time8) 22 | end 23 | 24 | 25 | total_time8 : REAL_64 26 | -- Return the travel time on the Metro Line 8 27 | do 28 | from 29 | Line8.stops.start 30 | Result:=0.0 31 | invariant 32 | -- The value of Result is the time to travel from first station 33 | -- to station at cursor position 34 | variant 35 | Line8.stops.count-Line8.stops.index 36 | until 37 | Line8.stops.index = Line8.stops.count 38 | loop 39 | Result := Result + Line8.stops.item.time_to_next 40 | Line8.stops.forth 41 | end 42 | end 43 | 44 | highest_name(line: TRAFFIC_LINE): STRING 45 | -- Alphabetically last of names of stations on line 46 | require 47 | line_exists: line /= void 48 | local 49 | i: INTEGER 50 | new: STRING 51 | do 52 | from 53 | Result := line.south_end.name 54 | i := 1 55 | invariant 56 | -- The value of `Result' is the the alphabetically last station name 57 | -- from the first station in the list to the current one 58 | variant 59 | line.count-i 60 | until 61 | i = line.count 62 | loop 63 | new := line.i_th (i).name 64 | if new > Result then 65 | Result := new 66 | end 67 | i := i + 1 68 | end 69 | end 70 | 71 | 72 | end 73 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/city_vision2/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/city_vision2/open.png -------------------------------------------------------------------------------- /solution/image/bus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/bus.png -------------------------------------------------------------------------------- /solution/image/free_moving.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/free_moving.png -------------------------------------------------------------------------------- /solution/image/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/man.png -------------------------------------------------------------------------------- /solution/image/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/open.png -------------------------------------------------------------------------------- /solution/image/taxi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/taxi.png -------------------------------------------------------------------------------- /solution/image/traffic_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/traffic_icon.png -------------------------------------------------------------------------------- /solution/image/train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/train.png -------------------------------------------------------------------------------- /solution/image/tram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/tram.png -------------------------------------------------------------------------------- /solution/image/zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/zoom_in.png -------------------------------------------------------------------------------- /solution/image/zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/image/zoom_out.png -------------------------------------------------------------------------------- /solution/map/dump.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/dump.log -------------------------------------------------------------------------------- /solution/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 | -------------------------------------------------------------------------------- /solution/map/paris.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris.dump -------------------------------------------------------------------------------- /solution/map/paris/centrepompidou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/centrepompidou.png -------------------------------------------------------------------------------- /solution/map/paris/chaillot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/chaillot.png -------------------------------------------------------------------------------- /solution/map/paris/citeuniversitaire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/citeuniversitaire.png -------------------------------------------------------------------------------- /solution/map/paris/congres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/congres.png -------------------------------------------------------------------------------- /solution/map/paris/defense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/defense.png -------------------------------------------------------------------------------- /solution/map/paris/eiffel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/eiffel.png -------------------------------------------------------------------------------- /solution/map/paris/hoteldeville.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/hoteldeville.png -------------------------------------------------------------------------------- /solution/map/paris/invalides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/invalides.png -------------------------------------------------------------------------------- /solution/map/paris/lachaise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/lachaise.png -------------------------------------------------------------------------------- /solution/map/paris/louvre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/louvre.png -------------------------------------------------------------------------------- /solution/map/paris/madeleine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/madeleine.png -------------------------------------------------------------------------------- /solution/map/paris/maisondelaradio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/maisondelaradio.png -------------------------------------------------------------------------------- /solution/map/paris/montparnasse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/montparnasse.png -------------------------------------------------------------------------------- /solution/map/paris/notredame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/notredame.png -------------------------------------------------------------------------------- /solution/map/paris/observatoire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/observatoire.png -------------------------------------------------------------------------------- /solution/map/paris/opera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/opera.png -------------------------------------------------------------------------------- /solution/map/paris/pantheon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/pantheon.png -------------------------------------------------------------------------------- /solution/map/paris/placedelaconcorde.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/placedelaconcorde.png -------------------------------------------------------------------------------- /solution/map/paris/placedelanation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/placedelanation.png -------------------------------------------------------------------------------- /solution/map/paris/placedelarepublique.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/placedelarepublique.png -------------------------------------------------------------------------------- /solution/map/paris/placedesvosges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/placedesvosges.png -------------------------------------------------------------------------------- /solution/map/paris/sacrecoeur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/sacrecoeur.png -------------------------------------------------------------------------------- /solution/map/paris/saintgermaindespres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/saintgermaindespres.png -------------------------------------------------------------------------------- /solution/map/paris/tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/tower.png -------------------------------------------------------------------------------- /solution/map/paris/triomphe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/paris/triomphe.png -------------------------------------------------------------------------------- /solution/map/zurich_little.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiffelhub/Traffic3/b76d42caf4c824a758a9de40475085907d4926ff/solution/map/zurich_little.dump -------------------------------------------------------------------------------- /solution/map/zurich_tiny.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /todo_.txt: -------------------------------------------------------------------------------- 1 | all: 2 | - Update eiffelmedia examples to work again 3 | 4 | Travelers: 5 | - Real itineraries and delays for trams 6 | - Tram depots where all the trams start until they are on their route. 7 | - Drawing of deboard and board of TRAFFIC_PASSENGERs 8 | 9 | Buildings: 10 | - Make building generation along lines faster 11 | 12 | Shortest path: 13 | - make shortest path calculation faster 14 | 15 | Map_widgets: 16 | - Use separate threads for handling mouse events (see Alan Fehr's report 5.3) 17 | - Use logarithmic search for finding clicked places (see Alan Fehr's report 5.3) 18 | 19 | Map loading: 20 | - improve error handling and messages 21 | - use SAX parsing 22 | 23 | 24 | last change $Date: 2008-09-16 16:34:07 +0200 (Вт, 16 сен 2008) $ 25 | --------------------------------------------------------------------------------