indexing
description: "Filled area's defined by any number of `points'."
legal: "See notice at end of class."
status: "See notice at end of class."
keywords: "figure, polygon"
date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
revision: "$Revision: 56675 $"
class interface
EV_MODEL_POLYGON
create
default_create
require ANY
True
make_with_coordinates (coords: ARRAY [EV_COORDINATE])
`coords'
require
coords_exist: coords /= Void
feature
angle: REAL_64
background_color: EV_COLOR
`Current'
EV_MODEL_CLOSED
dashed_line_style: BOOLEAN
EV_MODEL_ATOMIC
foreground_color: EV_COLOR
EV_MODEL_ATOMIC
generating_type: STRING_8
ANY
generator: STRING_8
ANY
group: EV_MODEL_GROUP
`Current'`Current'
EV_MODEL
i_th_point_x (i: INTEGER_32): INTEGER_32
`i'
EV_MODEL_MULTI_POINTED
require EV_MODEL_MULTI_POINTED
i_within_bounds: i > 0 and then i <= point_count
ensure EV_MODEL_MULTI_POINTED
correct_entry: Result = point_array.item (i - 1).x
i_th_point_y (i: INTEGER_32): INTEGER_32
`i'
EV_MODEL_MULTI_POINTED
require EV_MODEL_MULTI_POINTED
i_within_bounds: i > 0 and then i <= point_count
ensure EV_MODEL_MULTI_POINTED
correct_entry: Result = point_array.item (i - 1).y
id: INTEGER_32
EV_MODEL
ensure HASHABLE
good_hash_value: Result >= 0
frozen id_object (an_id: INTEGER_32): IDENTIFIED
`an_id'
IDENTIFIED
ensure IDENTIFIED
consistent: Result = Void or else Result.object_id = an_id
line_width: INTEGER_32
EV_MODEL_ATOMIC
frozen object_id: INTEGER_32
IDENTIFIED
ensure IDENTIFIED
valid_id: id_object (Result) = Current
pebble: ANY
EV_MODEL
pebble_function: FUNCTION [ANY, TUPLE, ANY]
`Void'pebble
EV_MODEL
point_count: INTEGER_32
`Current'
EV_MODEL
ensure EV_MODEL
correct: Result = point_array.count
pointer_style: EV_POINTER_STYLE
EV_MODEL
target_name: STRING_GENERAL
`Current'
EV_ABSTRACT_PICK_AND_DROPABLE
world: EV_MODEL_WORLD
`Current'`Current'
EV_MODEL
x: INTEGER_32
x
EV_MODEL
y: INTEGER_32
y
EV_MODEL
feature
frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
shallow_implies_deep: standard_equal (some, other) implies Result
both_or_none_void: (some = Void) implies (Result = (other = Void))
same_type: (Result and (some /= Void)) implies some.same_type (other)
symmetric: Result implies deep_equal (other, some)
frozen equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))
is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))
frozen standard_is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
same_type: Result implies same_type (other)
symmetric: Result implies other.standard_is_equal (Current)
feature
conforms_to (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
is_filled: BOOLEAN
EV_MODEL_CLOSED
is_hashable: BOOLEAN
HASHABLE
ensure HASHABLE
ok_if_not_default: Result implies (Current /= default)
is_rotatable: BOOLEAN is True
is_scalable: BOOLEAN is True
is_transformable: BOOLEAN is True
same_type (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
definition: Result = (conforms_to (other) and other.conforms_to (Current))
side_count: INTEGER_32
ensure
result_not_bigger_than_point_count: Result <= point_count
feature
disable_dashed_line_style
EV_MODEL_ATOMIC
ensure EV_MODEL_ATOMIC
dashed_line_style_disabled: not dashed_line_style
enable_dashed_line_style
EV_MODEL_ATOMIC
ensure EV_MODEL_ATOMIC
dashed_line_style_enabled: dashed_line_style
extend_point (a_point: EV_COORDINATE)
`a_point'`Current'
EV_MODEL_MULTI_POINTED
require EV_MODEL_MULTI_POINTED
a_point_not_void: a_point /= Void
ensure EV_MODEL_MULTI_POINTED
incremented: point_array.count = old point_array.count + 1
remove_background_color
EV_MODEL_CLOSED
ensure EV_MODEL_CLOSED
background_color_removed: background_color = Void
set_background_color (a_color: EV_COLOR)
background_color`a_color'
EV_MODEL_CLOSED
require EV_MODEL_CLOSED
a_color_exists: a_color /= Void
ensure EV_MODEL_CLOSED
background_color_assigned: background_color = a_color
set_foreground_color (a_color: EV_COLOR)
`a_color'foreground_color
EV_MODEL_ATOMIC
require EV_MODEL_ATOMIC
a_color_not_void: a_color /= Void
ensure EV_MODEL_ATOMIC
foreground_color_assigned: foreground_color = a_color
set_i_th_point_position (i: INTEGER_32; ax, ay: INTEGER_32)
`i'`ax'`ay'
EV_MODEL_MULTI_POINTED
require EV_MODEL_MULTI_POINTED
i_within_bounds: i > 0 and then i <= point_count
ensure EV_MODEL_MULTI_POINTED
assigned: i_th_point_x (i) = ax and i_th_point_y (i) = ay
set_i_th_point_x (i: INTEGER_32; a_x: INTEGER_32)
`a_x'`i'x
EV_MODEL_MULTI_POINTED
require EV_MODEL_MULTI_POINTED
i_within_bounds: i > 0 and then i <= point_count
ensure EV_MODEL_MULTI_POINTED
assigned: i_th_point_x (i) = a_x
set_i_th_point_y (i: INTEGER_32; a_y: INTEGER_32)
`a_y'`i'y
EV_MODEL_MULTI_POINTED
require EV_MODEL_MULTI_POINTED
i_within_bounds: i > 0 and then i <= point_count
ensure EV_MODEL_MULTI_POINTED
assigned: i_th_point_y (i) = a_y
set_line_width (a_width: INTEGER_32)
`a_width'line_width
EV_MODEL_ATOMIC
require EV_MODEL_ATOMIC
a_width_non_negative: a_width >= 0
ensure EV_MODEL_ATOMIC
line_width_assigned: line_width = a_width
set_point_count (a_count: INTEGER_32)
`a_count'point_count
EV_MODEL_MULTI_POINTED
require EV_MODEL_MULTI_POINTED
a_count_non_negative: a_count >= 0
ensure EV_MODEL_MULTI_POINTED
point_count_assigned: point_count = a_count
set_target_name (a_name: STRING_GENERAL)
`a_name'target_name
EV_ABSTRACT_PICK_AND_DROPABLE
require EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= Void
ensure EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)
feature
remove_pebble
pebble`Void'pebble_function
EV_MODEL
ensure EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = Void and pebble_function = Void
rotate (an_angle: REAL_64)
`an_angle'
EV_MODEL
require EV_MODEL
is_rotatable: is_rotatable
ensure EV_MODEL
center_valid: is_center_valid
rotate_around (an_angle: REAL_64; ax, ay: INTEGER_32)
`ax'`ay'`an_angle'
EV_MODEL
require EV_MODEL
is_rotatable: is_rotatable
ensure EV_MODEL
center_valid: is_center_valid
scale (a_scale: REAL_64)
`a_scale'
EV_MODEL
require EV_MODEL
is_scalable: is_scalable
a_scale_bigger_zero: a_scale > 0.0
scale_abs (a_scale: REAL_64)
`a_scale'
angle
EV_MODEL
require EV_MODEL
is_scalable: is_scalable
a_scale_bigger_zero: a_scale > 0.0
scale_x (a_scale_x: REAL_64)
`a_scale_x'
EV_MODEL
require EV_MODEL
is_scalable: is_scalable
a_scale_x_bigger_zero: a_scale_x > 0.0
scale_x_abs (a_scale_x: REAL_64)
`a_scale_x'
angle
EV_MODEL
require EV_MODEL
is_scalable: is_scalable
a_scale_x_bigger_zero: a_scale_x > 0.0
scale_y (a_scale_y: REAL_64)
`a_scale_y'
EV_MODEL
require EV_MODEL
is_scalable: is_scalable
a_scale_y_bigger_zero: a_scale_y > 0.0
scale_y_abs (a_scale_y: REAL_64)
`a_scale_y'
angle
EV_MODEL
require EV_MODEL
is_scalable: is_scalable
a_scale_y_bigger_zero: a_scale_y > 0.0
set_accept_cursor (a_cursor: EV_POINTER_STYLE)
`a_cursor'
pebble
EV_MODEL
require EV_ABSTRACT_PICK_AND_DROPABLE
a_cursor_not_void: a_cursor /= Void
ensure EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor.is_equal (a_cursor)
set_deny_cursor (a_cursor: EV_POINTER_STYLE)
`a_cursor'
EV_MODEL
require EV_ABSTRACT_PICK_AND_DROPABLE
a_cursor_not_void: a_cursor /= Void
ensure EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor.is_equal (a_cursor)
set_pebble (a_pebble: like pebble)
`a_pebble'pebble
EV_MODEL
require EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= Void
ensure EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble
set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
`a_function'pebble
EV_MODEL
require EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= Void
a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
ensure EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function
set_pointer_style (a_cursor: like pointer_style)
`a_cursor'pointer_style
EV_MODEL
require EV_MODEL
a_cursor_not_void: a_cursor /= Void
ensure EV_MODEL
pointer_style_assigned: pointer_style = a_cursor
set_x (a_x: INTEGER_32)
x`an_x'
EV_MODEL
ensure EV_MODEL
x_set: a_x = x
center_valid: is_center_valid
set_x_y (a_x, a_y: INTEGER_32)
x`a_x'y`a_y'
EV_MODEL
ensure EV_MODEL
set: a_x = x and a_y = y
center_valid: is_center_valid
set_y (a_y: INTEGER_32)
y`an_y'
EV_MODEL
ensure EV_MODEL
y_set: a_y = y
center_valid: is_center_valid
transform (a_transformation: EV_MODEL_TRANSFORMATION)
point_array`a_transformation'
`Current'
EV_MODEL
require EV_MODEL
a_transformation_not_void: a_transformation /= Void
is_transformable: is_transformable
feature
copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
frozen deep_copy (other: like Current)
copy`other'deep_twin
ANY
require ANY
other_not_void: other /= Void
ensure ANY
deep_equal: deep_equal (Current, other)
frozen deep_twin: like Current
ANY
ensure ANY
deep_equal: deep_equal (Current, Result)
frozen standard_copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_standard_equal: standard_is_equal (other)
frozen standard_twin: like Current
`other'
ANY
ensure ANY
standard_twin_not_void: Result /= Void
equal: standard_equal (Result, Current)
frozen twin: like Current
`Current'
twincopycopy
ANY
ensure ANY
twin_not_void: Result /= Void
is_equal: Result.is_equal (Current)
feature
frozen default: like Current
ANY
frozen default_pointer: POINTER
`POINTER'
`p'default
`p'`POINTER'
ANY
default_rescue
ANY
frozen do_nothing
ANY
feature
conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
EV_MODEL
drop_actions: EV_PND_ACTION_SEQUENCE
`Current'
EV_MODEL
pick_actions: EV_PND_START_ACTION_SEQUENCE
pebble
EV_MODEL
pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
EV_MODEL
pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
EV_MODEL
pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
EV_MODEL
pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
EV_MODEL
pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
EV_MODEL
pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
EV_MODEL
feature
bounding_box: EV_RECTANGLE
`Current'
EV_MODEL_ATOMIC
require EV_MODEL
True
ensure EV_MODEL
result_not_void: Result /= Void
internal_is_twin: internal_bounding_box /= Result
position_on_figure (a_x, a_y: INTEGER_32): BOOLEAN
`a_x'`a_y'
feature
io: STD_FILES
ANY
out: STRING_8
ANYtagged_out
ANY
print (some: ANY)
`some'
ANY
frozen tagged_out: STRING_8
ANYout
ANY
feature
operating_environment: OPERATING_ENVIRONMENT
ANY
feature
accept_cursor: EV_POINTER_STYLE
pebble
EV_MODEL
are_events_sended_to_group: BOOLEAN
pointer_motion_actionspointer_button_press_actions
pointer_double_press_actionspointer_button_release_actions
pointer_enter_actionspointer_leave_actions`Current'
`Current'
EV_MODEL
deny_cursor: EV_POINTER_STYLE
EV_MODEL
has_capture: BOOLEAN
`Current'
EV_MODEL
is_center_valid: BOOLEAN
EV_MODEL
is_in_group: BOOLEAN
`Current'
EV_MODEL
ensure EV_MODEL
group_defines_is_in_group: Result = (group /= Void)
is_in_world: BOOLEAN
`Current'
EV_MODEL
ensure EV_MODEL
world_defines_is_in_world: Result = (world /= Void)
is_sensitive: BOOLEAN
EV_MODEL
is_show_requested: BOOLEAN
`Current'
EV_MODEL
feature
disable_capture
world
EV_MODEL
require EV_MODEL
in_world: world /= Void
has_capture: has_capture
ensure EV_MODEL
capture_released: not has_capture
disable_events_sended_to_group
are_events_sended_to_group
EV_MODEL
ensure EV_MODEL
events_blocked: not are_events_sended_to_group
disable_sensitive
EV_MODEL
ensure EV_MODEL
insensitive_requested: not internal_is_sensitive
enable_capture
world
EV_MODEL
require EV_MODEL
in_world: world /= Void
ensure EV_MODEL
capture_set: has_capture
enable_events_sended_to_group
are_events_sended_to_group
EV_MODEL
ensure EV_MODEL
events_sended_to_group: are_events_sended_to_group
enable_sensitive
EV_MODEL
ensure EV_MODEL
sensitive_requested: internal_is_sensitive
hide
`Current'group
EV_MODEL
ensure EV_MODEL
not_is_show_requested: not is_show_requested
show
`Current'group
`True'
EV_MODEL
ensure EV_MODEL
is_show_requested: is_show_requested
feature EV_FIGURE
center_invalidate
EV_MODEL
invariant
EV_MODEL_ATOMIC
foreground_color_exists: foreground_color /= Void
line_width_non_negative: line_width >= 0
EV_MODEL
point_array_exists: point_array /= Void
center_exists: center /= Void
x_is_center_x: x = center.x
y_is_center_y: y = center.y
all_points_exist: all_points_exist (point_array)
projection_matrix_not_void: projection_matrix /= Void
is_transfomable_implies_rotatable_and_scalable: is_transformable implies (is_rotatable and is_scalable)
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
indexing
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
356 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end EV_MODEL_POLYGON