indexing description: "[ A decorator box that can be used to rotate child boxes in all three dimensions. The size of a rotator box is always at least as big as the unrotated size of its child. ]" author: "" date: "$Date$" revision: "$Revision$" class EM_VIZ_ROTATOR_BOX [B -> EM_VIZ_BOX] inherit EM_VIZ_DECORATOR_BOX [B] redefine vz_render, update end EM_VIZ_RESIZEABLE EM_VIZ_ROTATEABLE create make feature -- Initialization make -- Initialize do make_decorator make_rotateable create coordinate_frame.make_unit end feature -- Update mechanism update is -- local c: like size do -- Bounds needs to be updated already for what follows, so here we go: Precursor -- Now that this is done, let's continue with the important stuff. PLEASE? c := bounds.center coordinate_frame.make_unit coordinate_frame.translate (c) coordinate_frame.rotate (rotation_angle, rotation_axis) coordinate_frame.translate (-c) end feature {NONE} -- Implementation vz_render (viewing_direction: EM_VECTOR3D) is -- do setup_local_coordinate_frame vz_mult_frame (coordinate_frame) if item /= Void then item.render (coordinate_frame.inversed.map (viewing_direction)) end revert_local_coordinate_frame end coordinate_frame: EM_VIZ_COORDINATE_FRAME -- Frame used to orient contents invariant coordinate_frame_exists: coordinate_frame /= Void end