indexing
description: "Positions relative to other positions.Takes another relative point as origin and then defines ahor. & vert. scaling factor, x, y and angle.You can then access absolute scale_x, scale_y, x, y and anglewhich are recomputed only if invalidate_absolute_position hasbeen called.You may also choose to specify a positioner. This is an agentthat gets called everytime a recomputation is requested.When a positioner is installed, the other attributes are ignored.The x and y are transformed by the angle and scaling of the origin.This implies that the scale_x, scale_y and angle features of thisobject are only for propagation to referring points."
status: "See notice at end of class"
keywords: "point, position, location, origin"
date: "$Date$"
revision: "$Revision$"
class interface
EV_RELATIVE_POINT
create
default_create
make_with_origin (an_origin: EV_RELATIVE_POINT)
an_origin
make_with_origin_and_position (an_origin: EV_RELATIVE_POINT; new_x, new_y: INTEGER)
an_originnew_xnew_y
make_with_position (new_x, new_y: INTEGER)
new_xnew_y
make_with_positioner (pos_agent: like positioner)
pos_agent
feature
absolute_coordinates: EV_COORDINATE
angle: DOUBLE
angle_abs: DOUBLE
ensure
result_assigned: Result = last_angle_abs
frozen id_object (an_id: INTEGER): IDENTIFIED
an_id
IDENTIFIED
ensure IDENTIFIED
consistent: Result = void or else Result.object_id = an_id
frozen object_id: INTEGER
IDENTIFIED
ensure IDENTIFIED
valid_id: id_object (Result) = Current
origin: EV_RELATIVE_POINT
positioner: PROCEDURE [ANY, TUPLE [like Current]]
scale_x: DOUBLE
scale_x_abs: DOUBLE
ensure
result_assigned: Result = last_scale_x_abs
scale_y: DOUBLE
scale_y_abs: DOUBLE
ensure
result_assigned: Result = last_scale_y_abs
x: INTEGER
x_abs: INTEGER
ensure
result_assigned: Result = last_x_abs
y: INTEGER
y_abs: INTEGER
ensure
result_assigned: Result = last_y_abs
feature
being_positioned: BOOLEAN
has_positioner: BOOLEAN
ensure
result_assigned: Result = (positioner /= void)
relative_to (org: EV_RELATIVE_POINT): BOOLEAN
org
feature
change_origin (new_origin: EV_RELATIVE_POINT)
require
new_origin_not_void: new_origin /= void
no_dependance_circle: not new_origin.relative_to (Current)
set_angle (new_angle: DOUBLE)
set_angle_abs (new_angle_abs: DOUBLE)
ensure
last_angle_abs_assigned: last_angle_abs = new_angle_abs
set_origin (new_origin: EV_RELATIVE_POINT)
require
new_origin_not_void: new_origin /= void
no_dependance_circle: not new_origin.relative_to (Current) and new_origin /= Current
set_position (new_x, new_y: INTEGER)
xy
set_positioner (pos_agent: like positioner)
ensure
positioner_assigned: positioner = pos_agent
set_scale (new_scale: DOUBLE)
set_scale_x (new_scale_x: DOUBLE)
set_scale_x_abs (new_scale_x_abs: DOUBLE)
ensure
last_scale_x_abs_assigned: last_scale_x_abs = new_scale_x_abs
set_scale_y (new_scale_y: DOUBLE)
set_scale_y_abs (new_scale_y_abs: DOUBLE)
ensure
last_scale_y_abs_assigned: last_scale_y_abs = new_scale_y_abs
set_x (new_x: INTEGER)
set_x_abs (new_x_abs: INTEGER)
ensure
last_x_abs_assigned: last_x_abs = new_x_abs
set_y (new_y: INTEGER)
set_y_abs (new_y_abs: INTEGER)
ensure
last_y_abs_assigned: last_y_abs = new_y_abs
feature
out_abs: STRING
out_rel: STRING
invariant
notify_list_exists: notify_list_ids /= void
has_origin_implies_origin_notifies: origin /= void implies origin.notify_list_ids.has (object_id)
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
end -- EV_RELATIVE_POINT