indexing description: "[ A box that can contain other boxes. ]" author: "" date: "$Date$" revision: "$Revision$" deferred class EM_VIZ_COLLECTION_BOX [B -> EM_VIZ_BOX] inherit EM_VIZ_BOX redefine vz_compile, deep_expire, update end feature -- Initialization make_collection is -- Initialize do make_box end feature -- Access as_linear: DS_LINEAR [B] is -- Linear access to contents deferred ensure result_exists: Result /= Void end feature -- Measurement count: INTEGER is -- How many children? deferred end feature -- Status report is_empty: BOOLEAN is -- No children at all? deferred end has (b: B): BOOLEAN is -- Has `b' as a child? deferred end feature -- Update mechanism deep_expire -- Expire self and children local l: DS_LINEAR [B] b: B do Precursor from l := as_linear l.start until l.off loop b := l.item_for_iteration if b /= Void then b.deep_expire end l.forth end end update is -- Update children before self local l: DS_LINEAR [B] b: B do from l := as_linear l.start until l.off loop b := l.item_for_iteration if b /= Void then b.conditional_update end l.forth end resize_container realign_contents Precursor end feature {EM_VIZ_COLLECTION_BOX} -- Implementation adopt (b: B) is -- Adopt a child box `b' do if b /= Void then b.set_parent (Current) end expire ensure expired: needs_update end cast_out (b: B) is -- Cast out a child box `b' do if b /= Void then b.set_parent (Void) end expire ensure expired: needs_update end feature {NONE} -- Implementation vz_compile (viewing_direction: EM_VECTOR3D) is -- Compile children first local l: DS_LINEAR [B] b: B do from l := as_linear l.start until l.off loop b := l.item_for_iteration if b /= Void then b.vz_conditional_compile (viewing_direction) end l.forth end Precursor (viewing_direction) end resize_container is -- Resize container on update deferred end realign_contents is -- Realign contents after a resize deferred end end